This repository was archived by the owner on Mar 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Setup tests #16
Merged
Merged
Setup tests #16
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
79b01e7
Add initial test
Dreamsorcerer 3ba6bb3
CI
Dreamsorcerer 68ac571
Update requirements.txt
Dreamsorcerer 5e290f3
Update conftest.py
Dreamsorcerer 64bd87a
Update .mypy.ini
Dreamsorcerer f20c119
Update ci.yml
Dreamsorcerer ef50261
Update requirements.txt
Dreamsorcerer e1f9034
Update pyproject.toml
Dreamsorcerer a705d06
Update ci.yml
Dreamsorcerer d12f65a
Update client.py
Dreamsorcerer e90ad44
Create pytest.ini
Dreamsorcerer 2d90d44
Update .github/workflows/ci.yml
Dreamsorcerer c1217c0
Update client.py
Dreamsorcerer f559281
Apply suggestions from code review
Dreamsorcerer 2694007
Update .github/workflows/ci.yml
Dreamsorcerer 2a43dbc
Update client.py
Dreamsorcerer ff7d14b
Update __init__.py
Dreamsorcerer bafdad8
Update conftest.py
Dreamsorcerer 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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[pytest] | ||
addopts = | ||
# show 10 slowest invocations: | ||
--durations=10 | ||
# a bit of verbosity doesn't hurt: | ||
-v | ||
# report all the things == -rxXs: | ||
-ra | ||
# show values of the local vars in errors: | ||
--showlocals | ||
# coverage reports | ||
--cov=junction/ --cov=tests/ --cov-report term | ||
asyncio_mode = auto | ||
filterwarnings = | ||
error | ||
testpaths = tests/ | ||
xfail_strict = true |
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,3 +1,8 @@ | ||
aiohttp==3.10.6 | ||
aiojobs==1.3.0 | ||
coverage==7.6.1 | ||
mypy==1.11.2 | ||
pytest==8.3.3 | ||
pytest-aiohttp==1.0.5 | ||
pytest-asyncio==0.24 | ||
pytest-cov==5.0.0 |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import os | ||
from typing import AsyncIterator | ||
|
||
import pytest | ||
|
||
from junction import SANDBOX, JunctionClient | ||
|
||
@pytest.fixture | ||
async def client() -> AsyncIterator[JunctionClient]: | ||
key = os.environ["JUNCTION_API_KEY"] | ||
assert key | ||
async with JunctionClient(key, SANDBOX) as client: | ||
yield client |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from junction import JunctionClient | ||
|
||
async def test_no_results_iter(client: JunctionClient) -> None: | ||
no_result = False | ||
|
||
async for place in client.search_places(coords=(51.01, -32.51, 50)): | ||
assert False | ||
else: | ||
no_result = True | ||
|
||
assert no_result |
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.