diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-23 15:28:59 -0300 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2016-09-23 15:38:47 -0300 |
commit | 62e7904d8791a600474ca6491db75eb9102a1093 (patch) | |
tree | 180235903c9c0d195083f89fb740f641218a7319 /service/test/unit/resources | |
parent | e2cb0deda1e0668dd23e0fefc8020d10c1cad488 (diff) |
Replace SRPSession usages with bonafide
In order to replace leap_auth with bonafide, we created a
class to hold the user credentials
Diffstat (limited to 'service/test/unit/resources')
-rw-r--r-- | service/test/unit/resources/test_login_resource.py | 11 | ||||
-rw-r--r-- | service/test/unit/resources/test_users_resource.py | 9 |
2 files changed, 6 insertions, 14 deletions
diff --git a/service/test/unit/resources/test_login_resource.py b/service/test/unit/resources/test_login_resource.py index c2b89654..6383e25c 100644 --- a/service/test/unit/resources/test_login_resource.py +++ b/service/test/unit/resources/test_login_resource.py @@ -2,17 +2,16 @@ import os import test.support.mockito -from leap.exceptions import SRPAuthenticationError +from leap.bonafide._srp import SRPAuthError from mock import patch from mockito import mock, when, any as ANY, verify, verifyZeroInteractions, verifyNoMoreInteractions from twisted.trial import unittest from twisted.web.resource import IResource from twisted.web.test.requesthelper import DummyRequest -from pixelated.config.sessions import LeapSessionFactory, LeapSession -from pixelated.resources.login_resource import ( - LoginResource, - parse_accept_language) +from pixelated.config.sessions import LeapSession +from pixelated.resources.login_resource import LoginResource +from pixelated.resources.login_resource import parse_accept_language from test.unit.resources import DummySite @@ -246,7 +245,7 @@ class TestLoginPOST(unittest.TestCase): @patch('leap.auth.SRPAuth.authenticate') @patch('pixelated.config.services.Services.setup') def test_leap_session_is_not_created_when_leap_auth_fails(self, mock_service_setup, mock_leap_srp_auth, mock_leap_session_create): - mock_leap_srp_auth.side_effect = SRPAuthenticationError() + mock_leap_srp_auth.side_effect = SRPAuthError() d = self.web.get(self.request) diff --git a/service/test/unit/resources/test_users_resource.py b/service/test/unit/resources/test_users_resource.py index 9862209d..417bbcc9 100644 --- a/service/test/unit/resources/test_users_resource.py +++ b/service/test/unit/resources/test_users_resource.py @@ -1,17 +1,10 @@ -import os - import test.support.mockito -from leap.exceptions import SRPAuthenticationError -from mock import patch -from mockito import mock, when, any as ANY, verify, verifyZeroInteractions, verifyNoMoreInteractions +from mockito import mock, when, verify from twisted.trial import unittest -from twisted.web.resource import IResource from twisted.web.test.requesthelper import DummyRequest -from pixelated.config.sessions import LeapSessionFactory, LeapSession from pixelated.config.services import Services, ServicesFactory -from pixelated.resources.login_resource import LoginResource from pixelated.resources.users import UsersResource from test.unit.resources import DummySite |