Fix master build (#7873)
* Check in format diff * Remove cache http yaml files * Ignore tmp files generated by unit tests
This commit is contained in:
3
airbyte-cdk/python/.gitignore
vendored
3
airbyte-cdk/python/.gitignore
vendored
@@ -1 +1,4 @@
|
||||
.coverage
|
||||
|
||||
# TODO: these are tmp files generated by unit tests. They should go to the /tmp directory.
|
||||
cache_http_stream*.yml
|
||||
|
||||
@@ -54,7 +54,7 @@ class Oauth2Authenticator(HttpAuthenticator):
|
||||
return pendulum.now() > self._token_expiry_date
|
||||
|
||||
def get_refresh_request_body(self) -> Mapping[str, Any]:
|
||||
""" Override to define additional parameters """
|
||||
"""Override to define additional parameters"""
|
||||
payload: MutableMapping[str, Any] = {
|
||||
"grant_type": "refresh_token",
|
||||
"client_id": self.client_id,
|
||||
|
||||
@@ -48,19 +48,19 @@ def logger() -> AirbyteLogger:
|
||||
|
||||
|
||||
def test_successful_check():
|
||||
""" Tests that if a source returns TRUE for the connection check the appropriate connectionStatus success message is returned """
|
||||
"""Tests that if a source returns TRUE for the connection check the appropriate connectionStatus success message is returned"""
|
||||
expected = AirbyteConnectionStatus(status=Status.SUCCEEDED)
|
||||
assert expected == MockSource(check_lambda=lambda: (True, None)).check(logger, {})
|
||||
|
||||
|
||||
def test_failed_check():
|
||||
""" Tests that if a source returns FALSE for the connection check the appropriate connectionStatus failure message is returned """
|
||||
"""Tests that if a source returns FALSE for the connection check the appropriate connectionStatus failure message is returned"""
|
||||
expected = AirbyteConnectionStatus(status=Status.FAILED, message="'womp womp'")
|
||||
assert expected == MockSource(check_lambda=lambda: (False, "womp womp")).check(logger, {})
|
||||
|
||||
|
||||
def test_raising_check():
|
||||
""" Tests that if a source raises an unexpected exception the connection check the appropriate connectionStatus failure message is returned """
|
||||
"""Tests that if a source raises an unexpected exception the connection check the appropriate connectionStatus failure message is returned"""
|
||||
expected = AirbyteConnectionStatus(status=Status.FAILED, message="Exception('this should fail')")
|
||||
assert expected == MockSource(check_lambda=lambda: exec('raise Exception("this should fail")')).check(logger, {})
|
||||
|
||||
@@ -90,7 +90,7 @@ class MockStream(Stream):
|
||||
|
||||
|
||||
def test_discover(mocker):
|
||||
""" Tests that the appropriate AirbyteCatalog is returned from the discover method """
|
||||
"""Tests that the appropriate AirbyteCatalog is returned from the discover method"""
|
||||
airbyte_stream1 = AirbyteStream(
|
||||
name="1",
|
||||
json_schema={},
|
||||
@@ -113,7 +113,7 @@ def test_discover(mocker):
|
||||
|
||||
|
||||
def test_read_nonexistent_stream_raises_exception(mocker, logger):
|
||||
"""Tests that attempting to sync a stream which the source does not return from the `streams` method raises an exception """
|
||||
"""Tests that attempting to sync a stream which the source does not return from the `streams` method raises an exception"""
|
||||
s1 = MockStream(name="s1")
|
||||
s2 = MockStream(name="this_stream_doesnt_exist_in_the_source")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user