def __init__(self, param, szbase_dir, file_factory=FileFactory(), lock=True): self.param = param self.param_path = parampath.ParamPath(self.param, szbase_dir) self.file = None self.first_write = True self.file_factory = file_factory self.last = lastentry.LastEntry(param) self.lock = lock
def test_path3(self): temp_dir = tempfile.mkdtemp(suffix="meaner4_unit_test") pp = parampath.ParamPath(self.param2, temp_dir) os.makedirs(os.path.dirname(pp.create_file_path(0, 0))) for i in range(0, 10): with open(pp.create_file_path(i, i), "w") as f: pass self.assertEqual(pp.find_latest_path(), temp_dir + "/Kociol_3/Sterownik/Aktualne_wysterowanie_falownika_podmuchu/00000000090000000009.sz4") shutil.rmtree(temp_dir)
def test_path2(self): pp = parampath.ParamPath(self.param2, "/tmp") self.assertEqual(pp.create_file_path(1, 1), "/tmp/Kociol_3/Sterownik/Aktualne_wysterowanie_falownika_podmuchu/00000000010000000001.sz4")