diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-02-07 17:46:06 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-02-07 18:45:57 +0200 |
commit | 028fd279652dbe167b12b32dff00c6a299c4fc02 (patch) | |
tree | 4328795e0e96a493ef8e71ae29c81fc3e9811914 /subplot/data.py | |
parent | 3ef5bd7a3ab445509216116bb2f8009ace2b1080 (diff) | |
download | obnam2-028fd279652dbe167b12b32dff00c6a299c4fc02.tar.gz |
test: add scenario for live data file being unreadable
Diffstat (limited to 'subplot/data.py')
-rw-r--r-- | subplot/data.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/subplot/data.py b/subplot/data.py index f3faf2b..f7fb903 100644 --- a/subplot/data.py +++ b/subplot/data.py @@ -54,6 +54,20 @@ def _create_manifest_of_directory(ctx, dirname=None, manifest=None): open(manifest, "w").write(stdout) +def file_is_restored(ctx, filename=None, restored=None): + filename = os.path.join(restored, "./" + filename) + exists = os.path.exists(filename) + logging.debug(f"restored? {filename} {exists}") + assert exists + + +def file_is_not_restored(ctx, filename=None, restored=None): + filename = os.path.join(restored, "./" + filename) + exists = os.path.exists(filename) + logging.debug(f"restored? {filename} {exists}") + assert not exists + + def files_match(ctx, first=None, second=None): assert_eq = globals()["assert_eq"] |