def setUp(self): self.root_path = os.path.abspath(os.path.dirname(__file__) + "/../../") jsons = glob.glob(os.path.join(self.root_path, "data/*.json")) backups = glob.glob(os.path.join(self.root_path, "data/*.backup")) for file in jsons + backups: os.unlink(file) self.serials = Serials(name="serials", path=self.root_path)
def init(self, *args, **kwargs): path_root = os.path.abspath(os.path.dirname(__file__)) self.serials = Serials(name="serials", path=path_root) try: self.serials.set_all() except Exception, e: _logger.error(str(e))