Skip to content

Commit 7c4e45d

Browse files
committed
fix arguments for timescale test
1 parent 6696232 commit 7c4e45d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

alfalfa_worker/lib/utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ def to_bool(value: str):
2424
true_strings = ["true", "yes", "1"]
2525
if isinstance(value, bool):
2626
return value
27-
elif value.lower() in false_strings:
27+
if value is None:
2828
return False
29-
elif value.lower() in true_strings:
30-
return True
31-
else:
32-
raise ValueError(f"Invalid string \"{value}\" provided for boolean conversion")
29+
if isinstance(value, str):
30+
if value.lower() in false_strings:
31+
return False
32+
elif value.lower() in true_strings:
33+
return True
34+
raise ValueError(f"Invalid string \"{value}\" provided for boolean conversion")

tests/worker/test_job_step_run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def step_run_mock_job(dispatcher: Dispatcher):
2626
"start_datetime": str(datetime(2019, 1, 2, 0, 0, 0)),
2727
"end_datetime": str(datetime(2019, 1, 3, 0, 0, 0)),
2828
"timescale": "20",
29-
"realtime": None
29+
"realtime": False
3030
}
3131

3232
yield dispatcher.create_job(StepRunMockJob.job_path(), params)

0 commit comments

Comments
 (0)