-
Notifications
You must be signed in to change notification settings - Fork 2
test(core): clean up test structure #16
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
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a422ca3
test(core): port general behavior tests from TypeScript SDK
niklashigi 1d92975
Run tests in CI
niklashigi 23abbaf
Fix snapshots
niklashigi 0b81e4a
Add Mise tasks
niklashigi 05f6331
Add Python to Mise config
niklashigi ac71f83
Unify Python versions
niklashigi 072e8f7
Add `AGENTS.md` to explain testing
niklashigi 959399e
Deslop
niklashigi 45a903b
Add additional dev deps to Speakeasy config
niklashigi 3f1b6ea
Clean up #1
niklashigi cf19d99
Cleanup #2
niklashigi 38aca2e
Merge branch 'main' into test/core/clean-up-structure
niklashigi c71f6c7
Fix
niklashigi 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| """Tests for basic SDK behavior.""" | ||
|
|
||
| import pytest | ||
| from inline_snapshot import snapshot | ||
| from tests.conftest import MockContext | ||
|
|
||
|
|
@@ -157,3 +156,60 @@ def test_should_correctly_encode_boolean_query_parameters(self): | |
| request_without_deleted = ctx.get_last_request() | ||
| assert "include_deleted=false" in request_without_deleted.path | ||
|
|
||
| def test_should_correctly_serialize_post_request_body(self): | ||
| """Test that POST request bodies are correctly serialized.""" | ||
| ctx = MockContext() | ||
|
|
||
| ctx.mock_endpoint( | ||
| method="POST", | ||
| path="/v1/ats/jobs/test-job-id/applications", | ||
| response={ | ||
| "body": { | ||
| "status": "success", | ||
| "data": { | ||
| "id": "app-123", | ||
| "remote_id": "remote-app-123", | ||
| "outcome": "PENDING", | ||
| "rejection_reason_name": None, | ||
| "rejected_at": None, | ||
| "current_stage_id": "stage-1", | ||
| "job_id": "test-job-id", | ||
| "candidate_id": "candidate-456", | ||
| "custom_fields": {}, | ||
| "remote_url": "https://example.com/application/123", | ||
| "changed_at": "2024-01-01T00:00:00Z", | ||
| "remote_deleted_at": None, | ||
| "remote_created_at": "2024-01-01T00:00:00Z", | ||
| "remote_updated_at": "2024-01-01T00:00:00Z", | ||
| "current_stage": None, | ||
| "job": None, | ||
| "candidate": None, | ||
| }, | ||
| "warnings": [], | ||
| }, | ||
| }, | ||
| ) | ||
|
|
||
| # Make the API call | ||
| ctx.kombo.ats.create_application( | ||
| job_id="test-job-id", | ||
| candidate={ | ||
| "first_name": "Jane", | ||
| "last_name": "Smith", | ||
| "email_address": "[email protected]", | ||
| }, | ||
| ) | ||
|
|
||
| # Verify request body is correctly serialized | ||
| request = ctx.get_last_request() | ||
| assert request.method == "POST" | ||
| assert request.body == snapshot( | ||
| { | ||
| "candidate": { | ||
| "first_name": "Jane", | ||
| "last_name": "Smith", | ||
| "email_address": "[email protected]", | ||
| } | ||
| } | ||
| ) | ||
|
|
||
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.