def test_backup_config_success(self, path_args: Dict[str, pathlib.Path], config: ConfigHelper): cfg_path = path_args["moonraker.conf"] bkp_dest = cfg_path.parent.joinpath(f".{cfg_path.name}.bkp") if bkp_dest.exists(): pytest.fail("Backup Already Exists") config.create_backup() assert bkp_dest.is_file()
def test_backup_skip(self, path_args: Dict[str, pathlib.Path], config: ConfigHelper): cfg_path = path_args["moonraker.conf"] bkp_dest = cfg_path.parent.joinpath(f".{cfg_path.name}.bkp") if not bkp_dest.exists(): pytest.fail("Backup Not Present") stat = bkp_dest.stat() config.create_backup() assert stat == bkp_dest.stat()