Example #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")))
Example #2
0
File: test.py Project: mzpqnxow/psl
    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")))
Example #3
0
File: test.py Project: mzpqnxow/psl
 def test_flatbytestring(self):
     psl = PublicSuffixList(b("com\nnet\n"))
     self.assertEqual(psl.publicsuffix("example.com"), "com")
Example #4
0
 def test_flatbytestring(self):
     psl = PublicSuffixList(b("com\nnet\n"))
     self.assertEqual(psl.publicsuffix("example.com"), "com")