Exemple #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"]
Exemple #2
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)