def read_all_items(self, sodocu_config): directoryWalker = DirectoryWalker(self.get_path()) log.debug('directoryWalker.get_filenames(): ' + str(directoryWalker.get_filenames())) for filename in directoryWalker.get_filenames(): item_config = read_file(filename) item = create_item(sodocu_config, item_config, filename) self.add_item(item)
class TestDirectoryWalker(unittest.TestCase): @classmethod def setUpClass(self): self.project_sodocu_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, os.pardir)) self.directoryWalker = DirectoryWalker(self.project_sodocu_path + '/sodocu') @classmethod def tearDownClass(self): self.fileHandler = None def test_get_filenames(self): filenames = self.directoryWalker.get_filenames() # print filenames assert len(filenames) > 0
def setUpClass(self): self.project_sodocu_path = os.path.abspath(os.path.join(os.path.dirname( __file__ ), os.pardir, os.pardir)) self.directoryWalker = DirectoryWalker(self.project_sodocu_path + '/sodocu')