Esempio n. 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)
Esempio n. 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)
Esempio n. 3
0
 def setUp(self):
     self.processor = Processor(['./test_compiled.rule'], compiled=True)
Esempio n. 4
0
 def setUp(self):
     self.processor = Processor(['./test.rule'])
Esempio n. 5
0
 def setUp(self):
     self.processor = Processor(["./test_compiled.rule"], compiled=True)
Esempio n. 6
0
 def setUp(self):
     self.processor = Processor(["./test.rule"])