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

refactor: implementing abstract API class #74

Merged
merged 1 commit into from
Aug 2, 2023

Conversation

andrey-canon
Copy link
Collaborator

Description

This move the general logic from the FuturexAPIClient to a new Abstract class.

@github-actions github-actions bot added test size/m m lines label labels Aug 2, 2023
@johanseto johanseto self-assigned this Aug 2, 2023
@github-actions github-actions bot added size/l and removed size/m m lines label labels Aug 2, 2023
Classes:
LikeDislikeUnitExperienceTestCase: Test LikeDislikeUnitExperienceView.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

])
def setUp(self):
"""Setup common conditions for every test case"""
self.api_class = FuturexApiClient
Copy link
Collaborator

@johanseto johanseto Aug 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines could be?

api_client = FuturexApiClient()

api_client = FuturexApiClient()

api_client = self.api_class()

return {}
@property
def base_url(self):
return getattr(settings, "FUTUREX_API_URL")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs default value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, since in the past the decision was if someone wants to use it they must set up everything otherwise this would raise an exception

response.status_code,
)

return {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a refactor, but here you could a message of error or something related to the response...
How can I know if it is a 200 empty or an error? By the way, is the opportunity to handle it or maybe in the future because is working with that way now.

@andrey-canon andrey-canon force-pushed the and/refactor_futurex_api_client branch from dc04f28 to b8b3f65 Compare August 2, 2023 21:52
@johanseto johanseto self-requested a review August 2, 2023 22:04
This move the general logic from the FuturexAPIClient to a new Abstract class.
@andrey-canon andrey-canon force-pushed the and/refactor_futurex_api_client branch from b8b3f65 to a672ded Compare August 2, 2023 22:18
@andrey-canon andrey-canon merged commit 413bca7 into master Aug 2, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants