def test_valid_ids(self): self.assertTrue( verify_rp_id("example.com", "https://register.example.com")) self.assertTrue(verify_rp_id("example.com", "https://fido.example.com")) self.assertTrue( verify_rp_id("example.com", "https://www.example.com:444"))
def test_suffix_list(self): self.assertFalse(verify_rp_id(b"co.uk", "https://foobar.co.uk")) self.assertTrue(verify_rp_id(b"foobar.co.uk", "https://site.foobar.co.uk")) self.assertFalse(verify_rp_id(b"appspot.com", "https://example.appspot.com")) self.assertTrue( verify_rp_id(b"example.appspot.com", "https://example.appspot.com") )
def test_valid_ids(self): self.assertTrue( verify_rp_id('example.com', 'https://register.example.com')) self.assertTrue(verify_rp_id('example.com', 'https://fido.example.com')) self.assertTrue( verify_rp_id('example.com', 'https://www.example.com:444'))
def test_invalid_ids(self): self.assertFalse(verify_rp_id("example.com", "http://example.com")) self.assertFalse(verify_rp_id("example.com", "http://www.example.com")) self.assertFalse( verify_rp_id("example.com", "https://example-test.com")) self.assertFalse( verify_rp_id("companyA.hosting.example.com", "https://register.example.com")) self.assertFalse( verify_rp_id("companyA.hosting.example.com", "https://companyB.hosting.example.com"))
def test_invalid_ids_mixed_type(self): self.assertFalse(verify_rp_id(b"example.com", "http://example.com")) self.assertFalse(verify_rp_id("example.com", b"http://www.example.com")) self.assertFalse(verify_rp_id(b"example.com", b"https://example-test.com"))
def test_invalid_ids_mixed_type(self): self.assertFalse(verify_rp_id(b'example.com', 'http://example.com')) self.assertFalse(verify_rp_id('example.com', b'http://www.example.com')) self.assertFalse( verify_rp_id(b'example.com', b'https://example-test.com'))