Пример #1
0
 def test_hh_remove_msg(self):
     ''' test remove from heavy hitters exception message '''
     hh1 = HeavyHitters(num_hitters=2, width=1000, depth=5)
     self.assertEqual(hh1.add('this is a test', 3), 3)
     try:
         hh1.remove('this is a test')
     except NotSupportedError as ex:
         msg = ('Unable to remove elements in the HeavyHitters '
                'class as it is an un supported action (and does not'
                'make sense)!')
         self.assertEqual(str(ex), msg)
     else:
         self.assertEqual(True, False)
Пример #2
0
 def test_hh_remove_msg(self):
     ''' test remove from heavy hitters exception message '''
     hh1 = HeavyHitters(num_hitters=2, width=1000, depth=5)
     self.assertEqual(hh1.add('this is a test', 3), 3)
     try:
         hh1.remove('this is a test')
     except NotSupportedError as ex:
         msg = ('Unable to remove elements in the HeavyHitters '
                'class as it is an un supported action (and does not'
                'make sense)!')
         self.assertEqual(str(ex), msg)
     else:
         self.assertEqual(True, False)
Пример #3
0
 def test_hh_remove_msg(self):
     """test remove from heavy hitters exception message"""
     hh1 = HeavyHitters(num_hitters=2, width=1000, depth=5)
     self.assertEqual(hh1.add("this is a test", 3), 3)
     try:
         hh1.remove("this is a test")
     except NotSupportedError as ex:
         msg = (
             "Unable to remove elements in the HeavyHitters "
             "class as it is an un supported action (and does not"
             "make sense)!"
         )
         self.assertEqual(str(ex), msg)
     else:
         self.assertEqual(True, False)
Пример #4
0
 def test_hh_remove(self):
     ''' test remove from heavy hitters exception '''
     hh1 = HeavyHitters(num_hitters=2, width=1000, depth=5)
     self.assertEqual(hh1.add('this is a test', 3), 3)
     self.assertRaises(NotSupportedError,
                       lambda: hh1.remove('this is a test'))
Пример #5
0
 def test_hh_remove(self):
     """test remove from heavy hitters exception"""
     hh1 = HeavyHitters(num_hitters=2, width=1000, depth=5)
     self.assertEqual(hh1.add("this is a test", 3), 3)
     self.assertRaises(NotSupportedError, lambda: hh1.remove("this is a test"))