Skip to content

Commit

Permalink
#1010 source zendesk support: fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov-d committed Nov 21, 2022
1 parent bad769d commit 7686eb1
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def test_check(response, check_passed):
[
({"ticket_forms": [{"id": 1, "updated_at": "2021-07-08T00:05:45Z"}]}, 200, 18, []),
({"error": "Not sufficient permissions"}, 403, 17, [
'"error": "Not sufficient permissions"',
"An exception occurred while trying to access TicketForms stream: 403 Client"
]),
],
Expand All @@ -145,9 +144,9 @@ def test_full_access_streams(caplog, requests_mock, ticket_forms_response, statu
requests_mock.get("/api/v2/ticket_forms", status_code=status_code, json=ticket_forms_response)
result = SourceZendeskSupport().streams(config=TEST_CONFIG)
assert len(result) == expected_n_streams
logged_messages = iter(caplog.messages)
logged_warnings = iter([record for record in caplog.records if record.levelname == "WARNING"])
for msg in expected_warnings:
assert msg in next(logged_messages)
assert msg in next(logged_warnings).message


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 7686eb1

Please sign in to comment.