diff options
author | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-15 11:40:21 -0300 |
---|---|---|
committer | Thais Siqueira <thais.siqueira@gmail.com> | 2017-03-15 11:40:21 -0300 |
commit | 47f508a2e830a6cf06903d4bf7e771708b4c8c2c (patch) | |
tree | 0f559b9d6f3a92e2059b5035b3b5ea1cf60ceb17 /service/test/unit | |
parent | ea8ca5d0551e742a14ecabb5f23663c5e3e14c21 (diff) |
[#924] Fix duplication of tests
with @anikarni
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/test_application.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/service/test/unit/test_application.py b/service/test/unit/test_application.py index a61489fb..4861099c 100644 --- a/service/test/unit/test_application.py +++ b/service/test/unit/test_application.py @@ -98,23 +98,22 @@ class ApplicationTest(unittest.TestCase): @patch('leap.common.events.client') @patch('pixelated.application.reactor') @patch('pixelated.application.services.Services') - def test_that_start_user_agent_binds_to_ssl_if_ssl_options(self, services_mock, reactor_mock, _): - # FIXME patch something closer, instead of leap.common + def test_should_log_user_out_if_invalid_soledad_token(self, services_mock, reactor_mock, events_mock): app_mock = MagicMock() services_factory_mock = MagicMock() + + mock_service_log_user_out = MagicMock(return_value=None) + services_factory_mock.destroy_session = mock_service_log_user_out + leap_session = MagicMock() leap_session.fresh_account = False - pixelated.application._ssl_options = lambda x, y: 'options' - - config = ApplicationTest.MockConfig(12345, '127.0.0.1', sslkey="sslkey", sslcert="sslcert") + register_mock = events_mock.register + register_mock.register.return_value = None + config = ApplicationTest.MockConfig(12345, '127.0.0.1') d = pixelated.application.start_user_agent_in_single_user_mode(app_mock, services_factory_mock, config.home, leap_session) - def _assert(_): - services_mock.assert_called_once_with(leap_session) - - d.addCallback(_assert) - return d + pixelated.application.add_top_level_system_callbacks(d, services_factory_mock) def _assert_user_logged_out_using_uuid(_): used_arguments = register_mock.call_args[0] |