Esempio n. 1
0
def main():
    """ Main function """
    current_dir = os.getcwd()
    testdir = os.path.dirname(__file__)
    os.chdir(testdir)
    try:
        test_files = [ f for f in glob.glob("test_*.py") if os.path.isfile(f) ]
        helper.tests_runner(test_files)
    finally:
        os.chdir(current_dir)
Esempio n. 2
0
        """
        Getter
        """
        return self.cw_counter

class TestSerialTreeWatcher(TestTreeWatcher):
    """
    Our test class.
    We watch a specified directory, create some particular tree structure in it
    and check if we've got the right number of inotify events.

    Callbacks are called in the same process of the tree watcher,
    in a serial way.

    We just have to implement the setUp function with our callbacks.
    All the tests are in the TestTreeWatcher base class.
    """
    def setUp(self):
        """
        This function is called before each test
        We create and start our tree watcher
        """
        self.setup_helper(callbacks=SerialEventsCallbacks())


# see helper.py file and the tests_runner comments
TESTS_TO_RUN = [ "TestSerialTreeWatcher", ]

if __name__ == "__main__":
    helper.tests_runner(__file__)