Пример #1
0
class TestCompiledRule(unittest.TestCase):
    def setUp(self):
        self.processor = Processor(['./test_compiled.rule'], compiled=True)

    def test_match(self):
        self.processor.data = 'This is a dirty string.'
        results = self.processor.analyze()
        self.assertTrue(results)

    def test_no_match(self):
        self.processor.data = 'This is a clean string.'
        results = self.processor.analyze()
        self.assertFalse(results)
Пример #2
0
class TestCompiledRule(unittest.TestCase):
    def setUp(self):
        self.processor = Processor(["./test_compiled.rule"], compiled=True)

    def test_match(self):
        self.processor.data = "This is a dirty string."
        results = self.processor.analyze()
        self.assertTrue(results)

    def test_no_match(self):
        self.processor.data = "This is a clean string."
        results = self.processor.analyze()
        self.assertFalse(results)
Пример #3
0
 def setUp(self):
     self.processor = Processor(['./test_compiled.rule'], compiled=True)
Пример #4
0
 def setUp(self):
     self.processor = Processor(['./test.rule'])
Пример #5
0
 def setUp(self):
     self.processor = Processor(["./test_compiled.rule"], compiled=True)
Пример #6
0
 def setUp(self):
     self.processor = Processor(["./test.rule"])