fix: format all code with black
and from now on should not deviate from that...
This commit is contained in:
parent
45dabce956
commit
33ac0e008e
17 changed files with 730 additions and 576 deletions
|
@ -1,4 +1,4 @@
|
|||
#-*- coding: utf-8; -*-
|
||||
# -*- coding: utf-8; -*-
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
|
@ -16,22 +16,22 @@ class TestToWuttaHandler(DataTestCase):
|
|||
handler = self.make_handler()
|
||||
|
||||
# uses app title by default
|
||||
self.config.setdefault('wutta.app_title', "What About This")
|
||||
self.assertEqual(handler.get_target_title(), 'What About This')
|
||||
self.config.setdefault("wutta.app_title", "What About This")
|
||||
self.assertEqual(handler.get_target_title(), "What About This")
|
||||
|
||||
# or generic default if present
|
||||
handler.generic_target_title = "WHATABOUTTHIS"
|
||||
self.assertEqual(handler.get_target_title(), 'WHATABOUTTHIS')
|
||||
self.assertEqual(handler.get_target_title(), "WHATABOUTTHIS")
|
||||
|
||||
# but prefer specific title if present
|
||||
handler.target_title = "what_about_this"
|
||||
self.assertEqual(handler.get_target_title(), 'what_about_this')
|
||||
self.assertEqual(handler.get_target_title(), "what_about_this")
|
||||
|
||||
def test_make_target_session(self):
|
||||
handler = self.make_handler()
|
||||
|
||||
# makes "new" (mocked in our case) app session
|
||||
with patch.object(self.app, 'make_session') as make_session:
|
||||
with patch.object(self.app, "make_session") as make_session:
|
||||
make_session.return_value = self.session
|
||||
session = handler.make_target_session()
|
||||
make_session.assert_called_once_with()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue