Exemplo n.º 1
0
    def test_get_backed_up_files_simple(self, tmp_path: Path) -> None:
        # GIVEN
        backupdir = BackupDirectoryImpl(str(tmp_path))
        backuppath = Path(backupdir.ensure_backup_destination())
        backuppath.joinpath("one.txt").touch()
        backuppath.joinpath("subdir").mkdir()

        # WHEN
        files = backupdir.get_backed_up_files()

        # THEN
        assert files == ["one.txt", "subdir"]
Exemplo n.º 2
0
 def test_get_backed_up_files_empty(self, tmp_path: Path) -> None:
     backupdir = BackupDirectoryImpl(str(tmp_path))
     assert backupdir.get_backed_up_files() == []
Exemplo n.º 3
0
 def test_get_backup_destination(self, tmp_path: Path) -> None:
     backupdir = BackupDirectoryImpl(str(tmp_path))
     backuppath = backupdir.get_backup_destination()
     assert Path(backuppath) == tmp_path.joinpath("openvario", "backup")
Exemplo n.º 4
0
 def test_get_backed_up_files_no_dir(self) -> None:
     backupdir = BackupDirectoryImpl("/not/existing/dir")
     assert backupdir.get_backed_up_files() == []
Exemplo n.º 5
0
 def test_ensure_backup_destination(self, tmp_path: Path) -> None:
     backupdir = BackupDirectoryImpl(str(tmp_path))
     backuppath = backupdir.ensure_backup_destination()
     assert os.path.exists(backuppath)