Пример #1
0
    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")))
Пример #2
0
    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")))
Пример #3
0
 def test_flatbytestring(self):
     psl = PublicSuffixList(b("com\nnet\n"))
     self.assertEqual(psl.publicsuffix("example.com"), "com")
Пример #4
0
 def test_flatbytestring(self):
     psl = PublicSuffixList(b("com\nnet\n"))
     self.assertEqual(psl.publicsuffix("example.com"), "com")