diff options
author | Folker Bernitt <fbernitt@thoughtworks.com> | 2016-02-09 14:55:37 +0100 |
---|---|---|
committer | Folker Bernitt <fbernitt@thoughtworks.com> | 2016-02-09 14:55:37 +0100 |
commit | ecffe8699768b867765d382c41bc96e1067f3013 (patch) | |
tree | 2bc347e06dbc1ae8be756c747cb142b894a77428 /service/test/unit | |
parent | 34885b35a6ba28af0ac031355ee60801f8646b7e (diff) |
Close account on session close
- Issue #586
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/bitmask_libraries/test_session.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/service/test/unit/bitmask_libraries/test_session.py b/service/test/unit/bitmask_libraries/test_session.py index 9654e624..22c2b3d9 100644 --- a/service/test/unit/bitmask_libraries/test_session.py +++ b/service/test/unit/bitmask_libraries/test_session.py @@ -97,6 +97,19 @@ class SessionTest(AbstractLeapTest): self.assertIsNone(SessionCache.lookup_session(key)) @patch('pixelated.bitmask_libraries.session.register') + def test_close_ends_account_session(self, _): + account_mock = MagicMock() + email = 'someone@somedomain.tld' + self.provider.address_for.return_value = email + session = self._create_session() + session.account = account_mock + + with patch('pixelated.bitmask_libraries.session.unregister') as unregister_mock: + session.close() + + account_mock.end_session.assert_called_once_with() + + @patch('pixelated.bitmask_libraries.session.register') def test_session_fresh_is_initially_false(self, _): session = self._create_session() |