test for EnvironmentError that's not ENOENT

This commit is contained in:
meejah 2018-09-04 17:47:47 -06:00
parent ab812ca75f
commit 2e2bdf1ea1

View File

@ -38,6 +38,22 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
BASECONFIG)
return client.create_client(basedir)
@defer.inlineCallbacks
def test_unreadable_introducers(self):
"""
An error when private/introducers.yaml is unreadable (but exists)
"""
basedir = "test_client.Basic.test_unreadable_introduers"
os.mkdir(basedir, 0o700)
os.mkdir(os.path.join(basedir, 'private'), 0o700)
intro_fname = os.path.join(basedir, 'private', 'introducers.yaml')
with open(intro_fname, 'w') as f:
f.write("---\n")
os.chmod(intro_fname, 0o000)
with self.assertRaises(EnvironmentError):
yield client.create_client(basedir)
@defer.inlineCallbacks
def test_comment(self):
"""