summaryrefslogtreecommitdiff
path: root/subplot/client.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-08 08:51:14 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-08 10:43:22 +0200
commitf75eb2433ac790891eaeb07248cf98d525cd5a13 (patch)
tree07930c76003e0495f384e626b7fcc91dbb031816 /subplot/client.py
parent2e92cbb0aefbde6a015c67e3886514c8af61cb5b (diff)
downloadobnam2-f75eb2433ac790891eaeb07248cf98d525cd5a13.tar.gz
refactor: move functions around so that data stuff is in data.yaml
Diffstat (limited to 'subplot/client.py')
-rw-r--r--subplot/client.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/subplot/client.py b/subplot/client.py
index 75baa8f..d89b7d4 100644
--- a/subplot/client.py
+++ b/subplot/client.py
@@ -1,5 +1,4 @@
import os
-import subprocess
import yaml
@@ -47,39 +46,6 @@ def capture_generation_id(ctx, varname=None):
ctx["vars"] = v
-def create_manifest_of_live(ctx, dirname=None, manifest=None):
- _create_manifest_of_directory(ctx, dirname=dirname, manifest=manifest)
-
-
-def create_manifest_of_restored(ctx, dirname=None, restored=None, manifest=None):
- _create_manifest_of_directory(
- ctx, dirname=os.path.join(restored, "./" + dirname), manifest=manifest
- )
-
-
-def _create_manifest_of_directory(ctx, dirname=None, manifest=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_get_exit_code = globals()["runcmd_get_exit_code"]
- runcmd_get_stdout = globals()["runcmd_get_stdout"]
-
- runcmd_run(ctx, ["summain", dirname])
- assert runcmd_get_exit_code(ctx) == 0
- stdout = runcmd_get_stdout(ctx)
- open(manifest, "w").write(stdout)
-
-
-def files_match(ctx, first=None, second=None):
- assert_eq = globals()["assert_eq"]
-
- f = open(first).read()
- s = open(first).read()
- assert_eq(f, s)
-
-
-def live_and_restored_data_match(ctx, live=None, restore=None):
- subprocess.check_call(["diff", "-rq", f"{live}/.", f"{restore}/{live}/."])
-
-
def generation_list_contains(ctx, gen_id=None):
runcmd_stdout_contains = globals()["runcmd_stdout_contains"]
gen_id = ctx["vars"][gen_id]