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

Feature/to json (#2) #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Feature/to json (#2) #24

wants to merge 1 commit into from

Conversation

tnedev
Copy link

@tnedev tnedev commented Mar 17, 2022

  • Add to_json conversion for pyth client.

* Add to_json conversion for pyth client.
@tnedev
Copy link
Author

tnedev commented Mar 17, 2022

@SEJeff I've added tests and squashed the commits. Please take a look when you have a chance.

@tnedev
Copy link
Author

tnedev commented Apr 4, 2022

@SEJeff Any updates on someone reviewing the PR?

Copy link

@tompntn tompntn left a comment

Choose a reason for hiding this comment

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

Would be good to check the shape of the entire object in the tests, otherwise LGTM!

@@ -101,3 +101,17 @@ def test_price_info_str(price_info_trading):
expected = "PythPriceInfo status PythPriceStatus.TRADING price 596.09162"
assert str(price_info_trading) == expected
assert repr(price_info_trading) == expected

def test_price_info_to_json(price_info_trading):
Copy link

Choose a reason for hiding this comment

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

Would you be able to add a test which checks that the result of to_json is what we expect, instead of making assertions about the keys?

Copy link
Author

Choose a reason for hiding this comment

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

I don't remember very well at this point, but I think I made it that way so that tests fail if a developer updates the class attributes without updating the to_json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants