Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Sep 22, 2023
1 parent 892a43a commit cf13d6e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tests/steps/test_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def test_nested_step_decorator(rp_client):

assert rp_client.session.post.call_count == 1
assert rp_client.session.put.call_count == 1
assert len(rp_client._log_manager._batch) == 0
assert len(rp_client._log_batcher._batch) == 0


def test_nested_step_failed(rp_client):
Expand Down Expand Up @@ -136,26 +136,26 @@ def test_verify_parameters_logging_default_value(rp_client):
rp_client.session.post.side_effect = item_id_gen
rp_client._add_current_item(PARENT_STEP_ID)
nested_step_params(1, 'two')
assert len(rp_client._log_manager._batch) == 1
assert rp_client._log_manager._batch[0].message \
assert len(rp_client._log_batcher._batch) == 1
assert rp_client._log_batcher._batch[0].message \
== "Parameters: param1: 1; param2: two"


def test_verify_parameters_logging_no_default_value(rp_client):
rp_client.session.post.side_effect = item_id_gen
rp_client._add_current_item(PARENT_STEP_ID)
nested_step_params(1, 'two', 'three')
assert len(rp_client._log_manager._batch) == 1
assert rp_client._log_manager._batch[0].message \
assert len(rp_client._log_batcher._batch) == 1
assert rp_client._log_batcher._batch[0].message \
== "Parameters: param1: 1; param2: two; param3: three"


def test_verify_parameters_logging_named_value(rp_client):
rp_client.session.post.side_effect = item_id_gen
rp_client._add_current_item(PARENT_STEP_ID)
nested_step_params(1, 'two', param3='three')
assert len(rp_client._log_manager._batch) == 1
assert rp_client._log_manager._batch[0].message \
assert len(rp_client._log_batcher._batch) == 1
assert rp_client._log_batcher._batch[0].message \
== "Parameters: param1: 1; param2: two; param3: three"


Expand All @@ -164,8 +164,8 @@ def test_verify_parameters_inline_logging(rp_client):
rp_client._add_current_item(PARENT_STEP_ID)
with step(NESTED_STEP_NAME, params={'param1': 1, 'param2': 'two'}):
pass
assert len(rp_client._log_manager._batch) == 1
assert rp_client._log_manager._batch[0].message \
assert len(rp_client._log_batcher._batch) == 1
assert rp_client._log_batcher._batch[0].message \
== "Parameters: param1: 1; param2: two"


Expand All @@ -181,7 +181,7 @@ def test_two_level_nested_step_decorator(rp_client):

assert rp_client.session.post.call_count == 2
assert rp_client.session.put.call_count == 2
assert len(rp_client._log_manager._batch) == 0
assert len(rp_client._log_batcher._batch) == 0

request_uri = rp_client.session.post.call_args_list[0][0][0]
first_parent_id = request_uri[request_uri.rindex('/') + 1:]
Expand Down

0 comments on commit cf13d6e

Please sign in to comment.