diff options
author | Denis Costa <deniscostadsc@gmail.com> | 2016-10-24 17:42:38 -0200 |
---|---|---|
committer | Denis Costa <deniscostadsc@gmail.com> | 2016-10-26 14:34:31 -0200 |
commit | d9c4fb3707d85aa400f7042df2fbf7088f18739e (patch) | |
tree | 6b08cd048a885d6e4dc0d03e86bce87a815765d6 /service/test/unit/test_authentication.py | |
parent | 7e805dff08d4cbe14abab567edb7a301bdde6dda (diff) |
Fixes tests.
I also split Athenticaton class into two. So I keep the same API for old code
and have different things in two different classes. #795
Diffstat (limited to 'service/test/unit/test_authentication.py')
-rw-r--r-- | service/test/unit/test_authentication.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/service/test/unit/test_authentication.py b/service/test/unit/test_authentication.py index 2fb97d69..34138b5e 100644 --- a/service/test/unit/test_authentication.py +++ b/service/test/unit/test_authentication.py @@ -1,34 +1,32 @@ from twisted.trial import unittest -from leap.bitmask.bonafide._srp import SRPAuthError -from pixelated.authentication import Authentication +from pixelated.authentication import Authenticator -class AuthenticationTest(unittest.TestCase): - +class AuthenticatorTest(unittest.TestCase): def test_authenticates_with_username_and_password(self): self.fail() def test_validate_username_accepts_username(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertTrue(auth.validate_username('username')) def test_validate_username_accepts_email_address(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertTrue(auth.validate_username('username@domain.org')) def test_validate_username_denies_other_domains(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertFalse(auth.validate_username('username@wrongdomain.org')) def test_username_with_domain(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertEqual('user@domain.org', auth.username_with_domain('user')) def test_extract_username_extracts_from_plain_username(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertEqual(auth.extract_username('user'), 'user') def test_extract_username_extracts_from_email_address(self): - auth = Authentication('domain.org') + auth = Authenticator('domain.org') self.assertEqual(auth.extract_username('user@domain.org'), 'user') |