Skip to content

Commit e76059f

Browse files
Joe Reuterjbfbell
authored andcommitted
Source-Greenhouse: Fix unit tests for new CDK version (#28969)
Fix unit tests
1 parent ef95c9b commit e76059f

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

airbyte-integrations/connectors/source-greenhouse/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ COPY main.py ./
1212
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
1313
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
1414

15-
LABEL io.airbyte.version=0.4.1
15+
LABEL io.airbyte.version=0.4.2
1616
LABEL io.airbyte.name=airbyte/source-greenhouse

airbyte-integrations/connectors/source-greenhouse/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ data:
55
connectorSubtype: api
66
connectorType: source
77
definitionId: 59f1e50a-331f-4f09-b3e8-2e8d4d355f44
8-
dockerImageTag: 0.4.1
8+
dockerImageTag: 0.4.2
99
dockerRepository: airbyte/source-greenhouse
1010
githubIssueLabel: source-greenhouse
1111
icon: greenhouse.svg

airbyte-integrations/connectors/source-greenhouse/unit_tests/test_streams.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@ def create_response(headers):
2828
def test_next_page_token_has_next(applications_stream):
2929
headers = {"link": '<https://harvest.greenhouse.io/v1/applications?per_page=100&since_id=123456789>; rel="next"'}
3030
response = create_response(headers)
31-
next_page_token = applications_stream.retriever.next_page_token(response=response)
31+
next_page_token = applications_stream.retriever._next_page_token(response=response)
3232
assert next_page_token == {"next_page_token": "https://harvest.greenhouse.io/v1/applications?per_page=100&since_id=123456789"}
3333

3434

3535
def test_next_page_token_has_not_next(applications_stream):
3636
response = create_response({})
37-
next_page_token = applications_stream.retriever.next_page_token(response=response)
37+
next_page_token = applications_stream.retriever._next_page_token(response=response)
3838

3939
assert next_page_token is None
4040

4141

4242
def test_request_params_next_page_token_is_not_none(applications_stream):
4343
response = create_response({"link": f'<https://harvest.greenhouse.io/v1/applications?per_page={100}&since_id=123456789>; rel="next"'})
44-
next_page_token = applications_stream.retriever.next_page_token(response=response)
45-
request_params = applications_stream.retriever.request_params(next_page_token=next_page_token, stream_state={})
46-
path = applications_stream.retriever.path(next_page_token=next_page_token, stream_state={})
44+
next_page_token = applications_stream.retriever._next_page_token(response=response)
45+
request_params = applications_stream.retriever._request_params(next_page_token=next_page_token, stream_state={})
46+
path = applications_stream.retriever._paginator_path()
4747
assert "applications?per_page=100&since_id=123456789" == path
4848
assert request_params == {"per_page": 100}
4949

5050

5151
def test_request_params_next_page_token_is_none(applications_stream):
52-
request_params = applications_stream.retriever.request_params(stream_state={})
52+
request_params = applications_stream.retriever._request_params(stream_state={})
5353

5454
assert request_params == {"per_page": 100}
5555

@@ -138,7 +138,7 @@ def test_parse_response_expected_response(applications_stream):
138138
]
139139
"""
140140
response._content = response_content
141-
parsed_response = applications_stream.retriever.parse_response(response, stream_state={})
141+
parsed_response = applications_stream.retriever._parse_response(response, stream_state={})
142142
records = [dict(record) for record in parsed_response]
143143

144144
assert records == json.loads(response_content)
@@ -148,7 +148,7 @@ def test_parse_response_empty_content(applications_stream):
148148
response = requests.Response()
149149
response.status_code = 200
150150
response._content = b"[]"
151-
parsed_response = applications_stream.retriever.parse_response(response, stream_state={})
151+
parsed_response = applications_stream.retriever._parse_response(response, stream_state={})
152152
records = [record for record in parsed_response]
153153

154154
assert records == []
@@ -164,7 +164,7 @@ def test_ignore_403(applications_stream):
164164
response = requests.Response()
165165
response.status_code = 403
166166
response._content = b""
167-
parsed_response = applications_stream.retriever.parse_response(response, stream_state={})
167+
parsed_response = applications_stream.retriever._parse_response(response, stream_state={})
168168
records = [record for record in parsed_response]
169169
assert records == []
170170

@@ -173,5 +173,5 @@ def test_retry_429(applications_stream):
173173
response = requests.Response()
174174
response.status_code = 429
175175
response._content = b"{}"
176-
should_retry = applications_stream.retriever.should_retry(response)
176+
should_retry = applications_stream.retriever.requester._should_retry(response)
177177
assert should_retry is True

docs/integrations/sources/greenhouse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ The Greenhouse connector should not run into Greenhouse API limitations under no
6464

6565
| Version | Date | Pull Request | Subject |
6666
|:--------|:-----------|:---------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
67+
| 0.4.2 | 2023-08-02 | [28969](https://github.com/airbytehq/airbyte/pull/28969) | Update CDK version |
6768
| 0.4.1 | 2023-06-28 | [27773](https://github.com/airbytehq/airbyte/pull/27773) | Update following state breaking changes |
6869
| 0.4.0 | 2023-04-26 | [25332](https://github.com/airbytehq/airbyte/pull/25332) | Add new streams: `ActivityFeed`, `Approvals`, `Disciplines`, `Eeoc`, `EmailTemplates`, `Offices`, `ProspectPools`, `Schools`, `Tags`, `UserPermissions`, `UserRoles` |
6970
| 0.3.1 | 2023-03-06 | [23231](https://github.com/airbytehq/airbyte/pull/23231) | Publish using low-code CDK Beta version |

0 commit comments

Comments
 (0)