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