From ce2ced0b6be9bfe6c380dbed2eee22a788f3b0bf Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Sun, 18 Feb 2024 15:01:49 +0000 Subject: [PATCH] Add test for case where additional store is not known to jobflow-remote --- src/jobflow_remote/testing/__init__.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/jobflow_remote/testing/__init__.py b/src/jobflow_remote/testing/__init__.py index 53d40963..e3d6362a 100644 --- a/src/jobflow_remote/testing/__init__.py +++ b/src/jobflow_remote/testing/__init__.py @@ -45,7 +45,20 @@ def check_env_var() -> str: @job(big_files="data") def add_big(a: float, b: float): - """Adds two numbers together and writes the answer to an artificially large file.""" + """Adds two numbers together and writes the answer to an artificially large file + which is stored in a pre-defined store.""" + import pathlib + + result = a + b + with open("file.txt", "w") as f: + f.writelines([f"{result}"] * int(1e5)) + return Response({"data": pathlib.Path("file.txt"), "result": a + b}) + + +@job(undefined_store="data") +def add_big_undefined_store(a: float, b: float): + """Adds two numbers together and writes the answer to an artificially large file + which is attempted to be stored in a undefined store.""" import pathlib result = a + b