1
0
mirror of synced 2025-12-25 02:09:19 -05:00

Source GitHub: #970 handle 502 Bad Gateway (#21481)

* Source Github: handle 502 Bad Gateway with proper log message

* Source Github: bump version

* Source Github: update changelog for new 0.3.12 version

* auto-bump connector version

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
This commit is contained in:
Roman Yermilov [GL]
2023-01-19 23:27:30 +04:00
committed by GitHub
parent 96e16a890f
commit d1688c7287
4 changed files with 24 additions and 1 deletions

View File

@@ -189,6 +189,26 @@ def test_stream_teams_404():
assert responses.calls[0].request.url == "https://api.github.com/orgs/org_name/teams?per_page=100"
@responses.activate
@patch("time.sleep")
def test_stream_teams_502(sleep_mock):
organization_args = {"organizations": ["org_name"]}
stream = Teams(**organization_args)
url = "https://api.github.com/orgs/org_name/teams"
responses.add(
method="GET",
url=url,
status=requests.codes.BAD_GATEWAY,
json={"message": "Server Error"},
)
assert list(read_full_refresh(stream)) == []
assert len(responses.calls) == 6
# Check whether url is the same for all response.calls
assert set(call.request.url for call in responses.calls).symmetric_difference({f"{url}?per_page=100"}) == set()
@responses.activate
def test_stream_organizations_read():
organization_args = {"organizations": ["org1", "org2"]}