예제 #1
0
    def test_duplicated(self):
        path = os.path.join(_ROOT, 'data')
        sql_patchs = set([os.path.basename(fname)[:-4] for fname in
                          list_recursively(path, '*.sql')])
        py_patchs = set([os.path.basename(fname)[:-3] for fname in
                         list_recursively(path, '*.py')])
        identical_patchs = sql_patchs & py_patchs

        if identical_patchs:
            raise AssertionError("The patchs [%s] are duplicated" %
                                 (','.join(identical_patchs,)))
예제 #2
0
def get_stoq_sources(root):
    for dirpath in ['bin', 'data', 'plugins', 'stoq', 'stoqlib']:
        path = os.path.join(root, dirpath)
        for fname in list_recursively(path, '*.py'):
            if fname.endswith('__init__.py'):
                continue
            yield fname

        yield os.path.join(root, 'setup.py')