-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4776: Python CDK: Validate input config.py against spec #5457
Changes from 10 commits
d8a7437
db9609c
278e0af
a57965d
035f665
c019bce
e3d5279
c97588b
2896816
aa93cea
86e7457
e29552e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
# Initialize Auth Package | ||
from .core import HttpAuthenticator, NoAuth | ||
from .oauth import Oauth2Authenticator | ||
from .token import TokenAuthenticator | ||
from .token import MultipleTokenAuthenticator, TokenAuthenticator | ||
|
||
__all__ = [ | ||
"HttpAuthenticator", | ||
"NoAuth", | ||
"Oauth2Authenticator", | ||
"TokenAuthenticator", | ||
"MultipleTokenAuthenticator", | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -180,6 +180,7 @@ def test_run_check(self, mocker, destination: Destination, tmp_path): | |
parsed_args = argparse.Namespace(**args) | ||
destination.run_cmd(parsed_args) | ||
|
||
mocker.patch.object(destination, "spec", return_value=ConnectorSpecification(connectionSpecification={})) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should add a test case here too to verify the config is validated. It may help to look at test coverage by running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is already detailed test case that covers validation function here: https://github.com/airbytehq/airbyte/pull/5457/files#diff-0d9087e19f5bdabe137529bb861aaaa261b39d5344e79041602a2a94c7530301R150 So Ive just added checks if this validation function is called with correct args for destination. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, done |
||
expected_check_result = AirbyteConnectionStatus(status=Status.SUCCEEDED) | ||
mocker.patch.object(destination, "check", return_value=expected_check_result, autospec=True) | ||
|
||
|
@@ -216,6 +217,7 @@ def test_run_write(self, mocker, destination: Destination, tmp_path, monkeypatch | |
mocker.patch.object( | ||
destination, "write", return_value=iter(expected_write_result), autospec=True # convert to iterator to mimic real usage | ||
) | ||
mocker.patch.object(destination, "spec", return_value=ConnectorSpecification(connectionSpecification={})) | ||
# mock input is a record followed by some state messages | ||
mocked_input: List[AirbyteMessage] = [_wrapped(_record("s1", {"k1": "v1"})), *expected_write_result] | ||
mocked_stdin_string = "\n".join([record.json(exclude_unset=True) for record in mocked_input]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice docstring