Skip to content
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

Add tap tester #14

Merged
merged 34 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
16fea46
changes to tap entrypoint to work with rest of tap
Sep 17, 2021
f080302
changes to discover.py to work with rest of tap
Sep 17, 2021
e6bfe76
changes to schema.py to work with rest of the tap
Sep 17, 2021
0857584
changes to sync.py to work with rest of the tap
Sep 17, 2021
bd8bac8
updated README links to documentation
Sep 17, 2021
cb60599
changes to client.py:
Sep 17, 2021
8c8a893
initial working version of streams.py
Sep 18, 2021
7aa3c20
adding pagination to streams.py
Sep 21, 2021
806997c
adding links object as part of client return for pagination changes
Sep 21, 2021
3f8a7b5
adjusting indentation to match PEP8:
Sep 23, 2021
694a4a5
removing extraneous keys and related functions from discover.py
Sep 23, 2021
19418cd
changes to streams.py:
Sep 23, 2021
e138b89
adding tap-tester base.py
Sep 28, 2021
b8d6985
adding tap-tester sync canary
Sep 28, 2021
da59cd0
adding tap-tester discovery
Sep 28, 2021
bc3e350
adding tap-tester start date
Sep 28, 2021
4586cdd
adding tap-tester automated fields
Sep 28, 2021
531cada
changes to setup.py:
Sep 28, 2021
d537130
adding circleci config
Sep 28, 2021
c3cdcb0
adding tap-tester pagination
Sep 30, 2021
723ccda
fix for onetimes stream not supporting cursor based pagination
Sep 30, 2021
c0c5227
updating cirlce config
Oct 1, 2021
d5f9756
adding additional assertions per PR feedback
Oct 1, 2021
9e7f8e8
add additional streams to pagination test
Oct 1, 2021
43c0e52
switch customers stream to page based
Oct 1, 2021
39fdb3c
Make pylint happy
luandy64 Oct 1, 2021
267616a
Update tap-tester invocation
luandy64 Oct 1, 2021
ea83b51
pylint fixes
Oct 1, 2021
dcbba56
Merge branch 'pr-14' of https://github.com/singer-io/tap-recharge int…
Oct 1, 2021
3e3db8b
Merge branch 'singer-io-pr-14' into add-tap-tester
Oct 1, 2021
715807e
remove extraneous string interpolation
Oct 1, 2021
132eee7
remove extraneous class attributes for shop stream
Oct 1, 2021
6f35642
fixes to start_date test:
Oct 5, 2021
e70536d
adding assertion for valid-replication-keys to discover test
Oct 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: 'pylint'
command: |
source /usr/local/share/virtualenvs/tap-recharge/bin/activate
pylint tap_recharge --disable 'missing-module-docstring,missing-function-docstring,missing-class-docstring,no-else-raise,raise-missing-from,inconsistent-return-statements,logging-format-interpolation'
pylint tap_recharge --disable 'missing-module-docstring,missing-function-docstring,missing-class-docstring,no-else-raise,raise-missing-from,inconsistent-return-statements'
- run:
when: always
name: 'Integration Tests'
Expand Down
8 changes: 4 additions & 4 deletions tap_recharge/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def raise_for_error(response):
return
response = response.json()
if ('error' in response) or ('errorCode' in response):
message = '%s: %s' % (response.get('error', str(error)),
response.get('message', 'Unknown Error'))
message = f"{response.get('error', str(error))}: \
{response.get('message', 'Unknown Error')}"
error_code = response.get('status')
ex = get_exception_for_error_code(error_code)
if response.status_code == 401 and 'Expired access token' in message:
Expand Down Expand Up @@ -133,7 +133,7 @@ def check_access_token(self):
url='https://api.rechargeapps.com',
headers=headers)
if response.status_code != 200:
LOGGER.error('Error status_code = {}'.format(response.status_code))
LOGGER.error('Error status_code = %s', response.status_code)
raise_for_error(response)
else:
return True
Expand Down Expand Up @@ -190,7 +190,7 @@ def request(self, method, path=None, url=None, **kwargs):
try:
response_json = response.json()
except Exception as err:
LOGGER.error('{}'.format(err))
LOGGER.error('%s', err)
loeakaodas marked this conversation as resolved.
Show resolved Hide resolved
raise Exception(err)

return response_json, response.links
Expand Down
2 changes: 1 addition & 1 deletion tap_recharge/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_schemas():
field_metadata = {}

for stream_name, stream_object in STREAMS.items():
schema_path = get_abs_path('schemas/{}.json'.format(stream_name))
schema_path = get_abs_path(f'schemas/{stream_name}.json')
with open(schema_path, encoding='utf-8') as file:
schema = json.load(file)
schemas[stream_name] = schema
Expand Down