test(backups): do not store the status file in backupped folders

This commit is contained in:
Houkime 2023-07-12 16:00:36 +00:00
parent de8ef744eb
commit 326e3d3b0c

View file

@ -30,8 +30,7 @@ class DummyService(Service):
def __init__(self): def __init__(self):
super().__init__() super().__init__()
dir = self.folders[0] status_file = self.status_file()
status_file = path.join(dir, "service_status")
with open(status_file, "w") as file: with open(status_file, "w") as file:
file.write(ServiceStatus.ACTIVE.value) file.write(ServiceStatus.ACTIVE.value)
@ -81,7 +80,8 @@ class DummyService(Service):
@classmethod @classmethod
def status_file(cls) -> str: def status_file(cls) -> str:
dir = cls.folders[0] dir = cls.folders[0]
return path.join(dir, "service_status") # we do not REALLY want to store our state in our declared folders
return path.join(dir, "..", "service_status")
@classmethod @classmethod
def set_status(cls, status: ServiceStatus): def set_status(cls, status: ServiceStatus):
@ -99,8 +99,7 @@ class DummyService(Service):
cls, new_status: ServiceStatus, delay_sec: float cls, new_status: ServiceStatus, delay_sec: float
): ):
"""simulating a delay on systemd side""" """simulating a delay on systemd side"""
dir = cls.folders[0] status_file = cls.status_file()
status_file = path.join(dir, "service_status")
command = [ command = [
"bash", "bash",