add some docstrings, fix comments

This commit is contained in:
meejah 2018-08-24 16:50:04 -06:00
parent 536ccf8b6d
commit d478cf3831
3 changed files with 15 additions and 0 deletions

View File

@ -214,6 +214,9 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
self.failUnlessRaises(ValueError, client.create_client, basedir) self.failUnlessRaises(ValueError, client.create_client, basedir)
def test_web_apiauthtoken(self): def test_web_apiauthtoken(self):
"""
Client loads the proper API auth token from disk
"""
basedir = u"client.Basic.test_web_apiauthtoken" basedir = u"client.Basic.test_web_apiauthtoken"
create_node_dir(basedir, "testing") create_node_dir(basedir, "testing")
@ -243,6 +246,9 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
# TODO: also test config options for SFTP. # TODO: also test config options for SFTP.
def test_ftp_create(self): def test_ftp_create(self):
"""
configuration for sftpd results in it being started
"""
basedir = u"client.Basic.test_ftp_create" basedir = u"client.Basic.test_ftp_create"
create_node_dir(basedir, "testing") create_node_dir(basedir, "testing")
with open(os.path.join(basedir, "tahoe.cfg"), "w") as f: with open(os.path.join(basedir, "tahoe.cfg"), "w") as f:

View File

@ -42,6 +42,9 @@ class Node(testutil.SignalMixin, testutil.ReallyEqualMixin, unittest.TestCase):
IntroducerNode # pyflakes IntroducerNode # pyflakes
def test_create(self): def test_create(self):
"""
A brand new introducer creates its config dir
"""
basedir = "introducer.IntroducerNode.test_create" basedir = "introducer.IntroducerNode.test_create"
create_introducer(basedir) create_introducer(basedir)
self.assertTrue(os.path.exists(basedir)) self.assertTrue(os.path.exists(basedir))

View File

@ -138,6 +138,9 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
self.failUnless(config.nickname == nickname) self.failUnless(config.nickname == nickname)
def test_config_required(self): def test_config_required(self):
"""
Asking for missing (but required) configuration is an error
"""
basedir = u"test_node/test_config_required" basedir = u"test_node/test_config_required"
config = read_config(basedir, "portnum") config = read_config(basedir, "portnum")
@ -145,6 +148,9 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
config.get_config_from_file("it_does_not_exist", required=True) config.get_config_from_file("it_does_not_exist", required=True)
def test_private_config_unreadable(self): def test_private_config_unreadable(self):
"""
Asking for inaccessible private config is an error
"""
if "win32" in sys.platform.lower() or "cygwin" in sys.platform.lower(): if "win32" in sys.platform.lower() or "cygwin" in sys.platform.lower():
# We don't know how to test that unprivileged users can't read this # We don't know how to test that unprivileged users can't read this
# thing. (Also we don't know exactly how to set the permissions so # thing. (Also we don't know exactly how to set the permissions so