Esempio n. 1
0
 def testCategoryMissing(self):
     categ = Categorizor('querystring:category')
     self.assertIsNone(
         categ.categorize(
             'http://isp.example.com/blocked'
         )
     )
Esempio n. 2
0
 def testCategoryBase64(self):
     categ = Categorizor('querystring:category:base64')
     self.assertEquals(
         'violence',
         categ.categorize('http://isp.example.com/blocked?'
                          'category=dmlvbGVuY2U=')
     )
Esempio n. 3
0
 def testCategory(self):
     categ = Categorizor('querystring:category')
     self.assertEquals(
         'violence',
         categ.categorize('http://isp.example.com/blocked?'
                           'category=violence')
     )
Esempio n. 4
0
 def testCategoryMissing(self):
     categ = Categorizor('querystring:category')
     self.assertIsNone(categ.categorize('http://isp.example.com/blocked'))
Esempio n. 5
0
 def testCategoryBase64(self):
     categ = Categorizor('querystring:category:base64')
     self.assertEquals(
         'violence',
         categ.categorize('http://isp.example.com/blocked?'
                          'category=dmlvbGVuY2U='))
Esempio n. 6
0
 def testCategory(self):
     categ = Categorizor('querystring:category')
     self.assertEquals(
         'violence',
         categ.categorize('http://isp.example.com/blocked?'
                          'category=violence'))