Skip to content

Commit

Permalink
fix expected task keys in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Jul 22, 2024
1 parent 522e762 commit a63c9bd
Showing 1 changed file with 6 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ def happy_path():
== task_run.expected_start_time
)
assert pending.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
pending.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_happy_path.<locals>.happy_little_tree")
)
assert pending.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert pending.payload == {
"initial_state": None,
"intended": {"from": None, "to": "PENDING"},
Expand Down Expand Up @@ -112,11 +108,7 @@ def happy_path():
== task_run.expected_start_time
)
assert running.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
running.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_happy_path.<locals>.happy_little_tree")
)
assert running.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert running.payload == {
"intended": {"from": "PENDING", "to": "RUNNING"},
"initial_state": {
Expand Down Expand Up @@ -169,11 +161,7 @@ def happy_path():
== task_run.expected_start_time
)
assert completed.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
completed.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_happy_path.<locals>.happy_little_tree")
)
assert completed.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert completed.payload["task_run"].pop("estimated_run_time") > 0.0
assert (
pendulum.parse(completed.payload["task_run"].pop("start_time"))
Expand Down Expand Up @@ -262,11 +250,7 @@ def happy_path():
== task_run.expected_start_time
)
assert pending.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
pending.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_task_failure.<locals>.happy_little_tree")
)
assert pending.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert pending.payload == {
"initial_state": None,
"intended": {"from": None, "to": "PENDING"},
Expand Down Expand Up @@ -314,11 +298,7 @@ def happy_path():
== task_run.expected_start_time
)
assert running.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
running.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_task_failure.<locals>.happy_little_tree")
)
assert running.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert running.payload == {
"intended": {"from": "PENDING", "to": "RUNNING"},
"initial_state": {
Expand Down Expand Up @@ -374,11 +354,7 @@ def happy_path():
== task_run.expected_start_time
)
assert failed.payload["task_run"].pop("estimated_start_time_delta") > 0.0
assert (
failed.payload["task_run"]
.pop("task_key")
.startswith("test_task_state_change_task_failure.<locals>.happy_little_tree")
)
assert failed.payload["task_run"].pop("task_key").startswith("happy_little_tree")
assert failed.payload["task_run"].pop("estimated_run_time") > 0.0
assert (
pendulum.parse(failed.payload["task_run"].pop("start_time"))
Expand Down

0 comments on commit a63c9bd

Please sign in to comment.