summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
Diffstat (limited to 'subplot')
-rw-r--r--subplot/jt.py6
-rw-r--r--subplot/jt.yaml3
2 files changed, 9 insertions, 0 deletions
diff --git a/subplot/jt.py b/subplot/jt.py
index 312a22a..6ce75b0 100644
--- a/subplot/jt.py
+++ b/subplot/jt.py
@@ -153,3 +153,9 @@ def file_contains(ctx, variable=None, pattern=None):
data = f.read()
logging.debug(f"file content: {data!r}")
assert pattern in data
+
+
+def file_name_has_suffix(ctx, varname=None, suffix=None):
+ variables = ctx.get("variables", {})
+ filename = variables[varname]
+ assert filename.endswith(suffix)
diff --git a/subplot/jt.yaml b/subplot/jt.yaml
index 187f436..65bf90e 100644
--- a/subplot/jt.yaml
+++ b/subplot/jt.yaml
@@ -54,3 +54,6 @@
- then: journal entry <{variable}> contains "{pattern:text}"
function: file_contains
+
+- then: file name <{varname}> ends with {suffix}
+ function: file_name_has_suffix