def test_typeerror(self): self.assertRaises(TypeError, lambda: self.psl.suffix(None)) self.assertRaises(TypeError, lambda: self.psl.suffix(1)) if b("") != "": # python3 self.assertRaises(TypeError, lambda: self.psl.suffix(b("www.example.com")))
def test_flatbytestring(self): psl = PublicSuffixList(b("com\nnet\n")) self.assertEqual(psl.publicsuffix("example.com"), "com")