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 of test stack #114

Merged
merged 13 commits into from
Nov 19, 2024
Merged

Refactor of test stack #114

merged 13 commits into from
Nov 19, 2024

Conversation

sg-s
Copy link
Collaborator

@sg-s sg-s commented Nov 18, 2024

changes

see comments inline

problem description

our underlying stainless-generated code returned responses as objects. this was problematic because:

  • sometimes these pydantic models would fail to model_dump
  • this introduced a dependence on these models
  • tests became more complex because mock client needed to recreate all these objects

solution

  • switch to only dealing with dicts
  • overhaul the mock client to directly read from a stash of responses from the live client

@sg-s sg-s requested a review from a team as a code owner November 18, 2024 20:54
@sg-s sg-s self-assigned this Nov 18, 2024
Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
src/cli/data.py Show resolved Hide resolved
src/data_hub/_api.py Show resolved Hide resolved
src/data_hub/_api.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
src/cli/data.py Show resolved Hide resolved
src/cli/data.py Show resolved Hide resolved
src/data_hub/api.py Show resolved Hide resolved
src/data_hub/api.py Show resolved Hide resolved
src/data_hub/api.py Show resolved Hide resolved
src/data_hub/api.py Show resolved Hide resolved
tests/test_data_hub.py Show resolved Hide resolved
tests/test_data_hub.py Show resolved Hide resolved
tests/test_cli_config.py Show resolved Hide resolved
tests/mock_client.py Outdated Show resolved Hide resolved
src/utils/types.py Show resolved Hide resolved
src/utils/core.py Show resolved Hide resolved
src/utils/core.py Show resolved Hide resolved
Copy link
Contributor

@kennyjwilli kennyjwilli left a comment

Choose a reason for hiding this comment

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

This looks like a huge win wrt simplification. Hopefully you got all the snake -> camel cases! Let's test 🚢

src/cli/data.py Show resolved Hide resolved
src/cli/data.py Show resolved Hide resolved
src/data_hub/_api.py Show resolved Hide resolved
src/data_hub/_api.py Show resolved Hide resolved
src/data_hub/api.py Show resolved Hide resolved
src/data_hub/filters.py Show resolved Hide resolved
tests/fixtures/responses/create_database.json Show resolved Hide resolved
tests/test_cli_config.py Show resolved Hide resolved
@sg-s sg-s merged commit bef6e71 into main Nov 19, 2024
12 checks passed
@sg-s sg-s deleted the 11-15-filtering branch November 19, 2024 18:49
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