Пример #1
0
 def test_add_remove(self):
     word = str(uuid.uuid4()).replace("-", "")
     print(word)
     b = Bad(self.FILE)
     bad = b.bad(word)
     self.assertEqual(len(bad), 0)
     print(len(b.lines))
     b.add(word)
     print(len(b.lines))
     bad = b.bad(word)
     self.assertEqual(len(bad), 1)
     b.remove(word)
     bad = b.bad(word)
     self.assertEqual(len(bad), 0)
Пример #2
0
 def test_add_remove(self):
     word = str(uuid.uuid4()).replace("-", "")
     print(word)
     b = Bad(self.FILE)
     bad = b.bad(word)
     self.assertEqual(len(bad), 0)
     print(len(b.lines))
     b.add(word)
     print(len(b.lines))
     bad = b.bad(word)
     self.assertEqual(len(bad), 1)
     b.remove(word)
     bad = b.bad(word)
     self.assertEqual(len(bad), 0)
Пример #3
0
 def test_main(self):
     b = Bad(self.FILE)
     for case in self.CASES:
         text, sup = case
         bad = b.bad(text)
         self.assertEqual(len(bad) > 0, sup, text + " / " + repr(bad))
Пример #4
0
 def test_main(self):
     b = Bad(self.FILE)
     for case in self.CASES:
         text, sup = case
         bad = b.bad(text)
         self.assertEqual(len(bad) > 0, sup, text + " / " + repr(bad))