fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
e20ef31ff7
commit
1b01df79e2
9 changed files with 312 additions and 144 deletions
|
@ -17,5 +17,5 @@ class TestWuttaContinuumAppProvider(DataTestCase):
|
|||
self.assertFalse(provider.continuum_is_enabled())
|
||||
|
||||
# but can be turned on
|
||||
self.config.setdefault('wutta_continuum.enable_versioning', 'true')
|
||||
self.config.setdefault("wutta_continuum.enable_versioning", "true")
|
||||
self.assertTrue(provider.continuum_is_enabled())
|
||||
|
|
|
@ -17,8 +17,8 @@ class TestWuttaContinuumConfigExtension(DataTestCase):
|
|||
def test_startup(self):
|
||||
ext = self.make_extension()
|
||||
|
||||
with patch.object(mod, 'make_versioned') as make_versioned:
|
||||
with patch.object(mod, 'configure_mappers') as configure_mappers:
|
||||
with patch.object(mod, "make_versioned") as make_versioned:
|
||||
with patch.object(mod, "configure_mappers") as configure_mappers:
|
||||
|
||||
# nothing happens by default
|
||||
ext.startup(self.config)
|
||||
|
@ -26,7 +26,7 @@ class TestWuttaContinuumConfigExtension(DataTestCase):
|
|||
configure_mappers.assert_not_called()
|
||||
|
||||
# but will if we enable it in config
|
||||
self.config.setdefault('wutta_continuum.enable_versioning', 'true')
|
||||
self.config.setdefault("wutta_continuum.enable_versioning", "true")
|
||||
ext.startup(self.config)
|
||||
make_versioned.assert_called_once()
|
||||
configure_mappers.assert_called_once_with()
|
||||
|
@ -39,8 +39,8 @@ class TestWuttaContinuumPlugin(DataTestCase):
|
|||
|
||||
def test_remote_addr(self):
|
||||
plugin = self.make_plugin()
|
||||
with patch.object(socket, 'gethostbyname', return_value='127.0.0.1'):
|
||||
self.assertEqual(plugin.get_remote_addr(None, self.session), '127.0.0.1')
|
||||
with patch.object(socket, "gethostbyname", return_value="127.0.0.1"):
|
||||
self.assertEqual(plugin.get_remote_addr(None, self.session), "127.0.0.1")
|
||||
|
||||
def test_user_id(self):
|
||||
plugin = self.make_plugin()
|
||||
|
@ -48,11 +48,14 @@ class TestWuttaContinuumPlugin(DataTestCase):
|
|||
|
||||
def test_transaction_args(self):
|
||||
plugin = self.make_plugin()
|
||||
with patch.object(socket, 'gethostbyname', return_value='127.0.0.1'):
|
||||
self.assertEqual(plugin.transaction_args(None, self.session),
|
||||
{'remote_addr': '127.0.0.1'})
|
||||
with patch.object(socket, "gethostbyname", return_value="127.0.0.1"):
|
||||
self.assertEqual(
|
||||
plugin.transaction_args(None, self.session),
|
||||
{"remote_addr": "127.0.0.1"},
|
||||
)
|
||||
|
||||
with patch.object(plugin, 'get_user_id', return_value='some-random-uuid'):
|
||||
self.assertEqual(plugin.transaction_args(None, self.session),
|
||||
{'remote_addr': '127.0.0.1',
|
||||
'user_id': 'some-random-uuid'})
|
||||
with patch.object(plugin, "get_user_id", return_value="some-random-uuid"):
|
||||
self.assertEqual(
|
||||
plugin.transaction_args(None, self.session),
|
||||
{"remote_addr": "127.0.0.1", "user_id": "some-random-uuid"},
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue