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