Ejemplo n.º 1
0
class PyWatchEventProcessorTest(unittest.TestCase):
    def setUp(self):
        self.processor = PyWatchEventProcessor()

    def test_that_we_only_accept_regexp(self):
        def f(matcher):
            f.called = True

        f.called = False
        self.processor.addRule(package_classname_pattern, f)
        self.processor.process_default(d)
        self.assertTrue(f.called)

    def test_that_we_get_the_matcher_object(self):
        def matcher_validator(matcher):
            self.assertTrue(matcher.group(1))
            self.assertEquals("com/ontotext/", matcher.group("package_dir"))
            self.assertEquals("Hello", matcher.group("classname"))

        self.processor.addRule(package_classname_pattern, matcher_validator)
        self.processor.process_default(d)
Ejemplo n.º 2
0
class PyWatchEventProcessorTest(unittest.TestCase):
    def setUp(self):
        self.processor = PyWatchEventProcessor()

    def test_that_we_only_accept_regexp(self):
        def f(matcher):
            f.called = True

        f.called = False
        self.processor.addRule(package_classname_pattern, f)
        self.processor.process_default(d)
        self.assertTrue(f.called)

    def test_that_we_get_the_matcher_object(self):
        def matcher_validator(matcher):
            self.assertTrue(matcher.group(1))
            self.assertEquals("com/ontotext/", matcher.group("package_dir"))
            self.assertEquals("Hello", matcher.group("classname"))

        self.processor.addRule(package_classname_pattern, matcher_validator)
        self.processor.process_default(d)
Ejemplo n.º 3
0
 def setUp(self):
     self.processor = PyWatchEventProcessor()
Ejemplo n.º 4
0
 def setUp(self):
     self.processor = PyWatchEventProcessor()