Skip to content

Commit

Permalink
Added case CANCELED for test_wait_for_state in Tableau Hook tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Zanchi committed Jul 19, 2021
1 parent 94c4ac6 commit e79c63f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/providers/tableau/hooks/test_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,20 @@ def test_wait_for_state(self, mock_tableau_server):
job_id='j1', target_state=TableauJobFinishCode.ERROR, check_interval=1
)

# Test CANCELLED Positive
with TableauHook(tableau_conn_id='tableau_test_password') as tableau_hook:
tableau_hook.get_job_status = MagicMock(
name='get_job_status',
side_effect=[
TableauJobFinishCode.PENDING,
TableauJobFinishCode.PENDING,
TableauJobFinishCode.CANCELED,
],
)
assert tableau_hook.wait_for_state(
job_id='j1', target_state=TableauJobFinishCode.CANCELED, check_interval=1
)

# Test PENDING Positive
with TableauHook(tableau_conn_id='tableau_test_password') as tableau_hook:
tableau_hook.get_job_status = MagicMock(
Expand Down

0 comments on commit e79c63f

Please sign in to comment.