-
Notifications
You must be signed in to change notification settings - Fork 88
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
TDL-5961 Support of custom domain #172
Merged
prijendev
merged 13 commits into
TDl-19530-update-dict-based-implementation-to-class-based
from
TDL-5961-support-custom-domain
Aug 8, 2022
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
0b6c871
Initial commit.
prijendev 2476a6d
Removed url from the stream class.
prijendev 4ce091a
Updated readme and sample config.
prijendev 0ae68ec
Merge branch 'TDl-19530-update-dict-based-implementation-to-class-bas…
namrata270998 ba73d8f
Updated sync test to utilize custom domain config parameter `base_url`.
prijendev edb887f
Merge branch 'TDl-19530-update-dict-based-implementation-to-class-bas…
prijendev 106945c
Updated test_stream unit test.
prijendev e2d0343
Removed duplicate comment.
prijendev 10ff541
Merge branch 'TDl-19530-update-dict-based-implementation-to-class-bas…
prijendev 5647e09
Merge branch 'TDl-19530-update-dict-based-implementation-to-class-bas…
namrata270998 54cf935
Added support of empty string in custom domain.
prijendev 93276b4
Merge branch 'TDL-5961-support-custom-domain' of https://github.com/s…
prijendev 5191c02
Merge branch 'TDl-19530-update-dict-based-implementation-to-class-bas…
prijendev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import unittest | ||
from unittest import mock | ||
from tap_github.client import GithubClient, DEFAULT_DOMAIN | ||
|
||
@mock.patch('tap_github.GithubClient.verify_access_for_repo', return_value = None) | ||
class TestCustomDomain(unittest.TestCase): | ||
""" | ||
Test custom domain is supported in client | ||
""" | ||
|
||
def test_config_without_domain(self, mock_verify_access): | ||
""" | ||
Test if the domain is not given in the config | ||
""" | ||
mock_config = {'repository': 'singer-io/test-repo', "access_token": ""} | ||
test_client = GithubClient(mock_config) | ||
|
||
# Verify domain in client is default | ||
self.assertEqual(test_client.base_url, DEFAULT_DOMAIN) | ||
|
||
def test_config_with_domain(self, mock_verify_access): | ||
""" | ||
Test if the domain is given in the config | ||
""" | ||
mock_config = {'repository': 'singer-io/test-repo', "api_endpoint": "http://CUSTOM-git.com", "access_token": ""} | ||
test_client = GithubClient(mock_config) | ||
|
||
# Verify domain in client is from config | ||
self.assertEqual(test_client.base_url, mock_config["api_endpoint"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Also need to update the readMe file as well.
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.
Updated readme file and client class attribute
self.base_url
.