Example #1
0
 def test_overide_robots(self):
     """Check that robots can be overridden as mobile."""
     c = Categorizr()
     d = c.detect('bot')
     self.assertEqual(d.category, 'desktop')
     c1 = Categorizr(robots_as_mobile=True)
     d = c1.detect('bot')
     self.assertEqual(d.category, 'mobile')
Example #2
0
 def test_overide_tablets(self):
     """Check that tablets can be overridden as desktop."""
     c = Categorizr()
     d = c.detect('tablet')
     self.assertEqual(d.category, 'tablet')
     c1 = Categorizr(tablets_as_desktops=True)
     d = c1.detect('tablet')
     self.assertEqual(d.category, 'desktop')
Example #3
0
 def test_overide_tvs(self):
     """Check that TVs can be overridden as desktop."""
     c = Categorizr()
     d = c.detect('googletv')
     self.assertEqual(d.category, 'tv')
     c1 = Categorizr(tvs_as_desktops=True)
     d = c1.detect('googletv')
     self.assertEqual(d.category, 'desktop')
Example #4
0
 def inner_test(self):
     c = Categorizr()
     d = c.detect(test[0])
     self.assertEqual(d.category, test[1])
Example #5
0
 def test_find(self):
     """Ensure the find function can do a case insensitive find."""
     c = Categorizr()
     self.assertTrue(c._find('edc', 'MixedCase'))