mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
flake8
This commit is contained in:
@ -28,7 +28,6 @@ from allmydata.history import History
|
|||||||
from allmydata.interfaces import IStatsProducer, SDMF_VERSION, MDMF_VERSION
|
from allmydata.interfaces import IStatsProducer, SDMF_VERSION, MDMF_VERSION
|
||||||
from allmydata.nodemaker import NodeMaker
|
from allmydata.nodemaker import NodeMaker
|
||||||
from allmydata.blacklist import Blacklist
|
from allmydata.blacklist import Blacklist
|
||||||
from allmydata import node
|
|
||||||
|
|
||||||
|
|
||||||
KiB=1024
|
KiB=1024
|
||||||
|
@ -216,7 +216,6 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
|
|||||||
def test_web_apiauthtoken(self):
|
def test_web_apiauthtoken(self):
|
||||||
basedir = u"client.Basic.test_web_apiauthtoken"
|
basedir = u"client.Basic.test_web_apiauthtoken"
|
||||||
create_node_dir(basedir, "testing")
|
create_node_dir(basedir, "testing")
|
||||||
config = read_config(basedir, "portnum")
|
|
||||||
|
|
||||||
c = client.create_client(basedir)
|
c = client.create_client(basedir)
|
||||||
# this must come after we create the client, as it will create
|
# this must come after we create the client, as it will create
|
||||||
@ -255,7 +254,7 @@ class Basic(testutil.ReallyEqualMixin, testutil.NonASCIIPathMixin, unittest.Test
|
|||||||
'host_privkey_file = privkey\n'
|
'host_privkey_file = privkey\n'
|
||||||
)
|
)
|
||||||
with mock.patch('allmydata.frontends.sftpd.SFTPServer') as p:
|
with mock.patch('allmydata.frontends.sftpd.SFTPServer') as p:
|
||||||
c = client.create_client(basedir)
|
client.create_client(basedir)
|
||||||
self.assertTrue(p.called)
|
self.assertTrue(p.called)
|
||||||
|
|
||||||
def test_ftp_auth_keyfile(self):
|
def test_ftp_auth_keyfile(self):
|
||||||
|
@ -141,7 +141,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
|||||||
basedir = u"test_node/test_config_required"
|
basedir = u"test_node/test_config_required"
|
||||||
config = read_config(basedir, "portnum")
|
config = read_config(basedir, "portnum")
|
||||||
|
|
||||||
with self.assertRaises(Exception) as ctx:
|
with self.assertRaises(Exception):
|
||||||
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):
|
||||||
@ -152,7 +152,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
|||||||
fname = os.path.join(basedir, "private", "foo")
|
fname = os.path.join(basedir, "private", "foo")
|
||||||
os.chmod(fname, 0)
|
os.chmod(fname, 0)
|
||||||
|
|
||||||
with self.assertRaises(Exception) as ctx:
|
with self.assertRaises(Exception):
|
||||||
config.get_or_create_private_config("foo")
|
config.get_or_create_private_config("foo")
|
||||||
|
|
||||||
def test_private_config_unreadable_preexisting(self):
|
def test_private_config_unreadable_preexisting(self):
|
||||||
@ -164,7 +164,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
|||||||
f.write("stuff")
|
f.write("stuff")
|
||||||
os.chmod(fname, 0)
|
os.chmod(fname, 0)
|
||||||
|
|
||||||
with self.assertRaises(Exception) as ctx:
|
with self.assertRaises(Exception):
|
||||||
config.get_private_config("foo")
|
config.get_private_config("foo")
|
||||||
|
|
||||||
def test_private_config_missing(self):
|
def test_private_config_missing(self):
|
||||||
@ -172,7 +172,7 @@ class TestCase(testutil.SignalMixin, unittest.TestCase):
|
|||||||
create_node_dir(basedir, "testing")
|
create_node_dir(basedir, "testing")
|
||||||
config = read_config(basedir, "portnum")
|
config = read_config(basedir, "portnum")
|
||||||
|
|
||||||
with self.assertRaises(MissingConfigEntry) as ctx:
|
with self.assertRaises(MissingConfigEntry):
|
||||||
config.get_or_create_private_config("foo")
|
config.get_or_create_private_config("foo")
|
||||||
|
|
||||||
def test_private_config(self):
|
def test_private_config(self):
|
||||||
|
Reference in New Issue
Block a user