-
Notifications
You must be signed in to change notification settings - Fork 14
fix: Presigned resource urls shouldn't follow base url #500
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
Changes from 6 commits
bb5a260
1db6008
6fb6f03
d7163b8
77c5f20
a28026c
116621b
2d31a37
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,30 @@ | |
TOKEN_ENV_VAR = 'APIFY_TEST_USER_API_TOKEN' | ||
API_URL_ENV_VAR = 'APIFY_INTEGRATION_TESTS_API_URL' | ||
|
||
parametrized_api_urls = pytest.mark.parametrize( | ||
('api_url', 'api_public_url'), | ||
[ | ||
('https://api.apify.com', 'https://api.apify.com'), | ||
('https://api.apify.com', None), | ||
barjin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
('https://api.apify.com', 'https://custom-public-url.com'), | ||
('https://api.apify.com', 'https://custom-public-url.com/with/custom/path'), | ||
('https://api.apify.com', 'https://custom-public-url.com/with/custom/path/'), | ||
('http://10.0.88.214:8010', 'https://api.apify.com'), | ||
|
||
], | ||
) | ||
|
||
@pytest.fixture | ||
def apify_client() -> ApifyClient: | ||
api_token = os.getenv(TOKEN_ENV_VAR) | ||
api_url = os.getenv(API_URL_ENV_VAR) | ||
|
||
if not api_token: | ||
@pytest.fixture | ||
def api_token() -> str: | ||
token = os.getenv(TOKEN_ENV_VAR) | ||
if not token: | ||
raise RuntimeError(f'{TOKEN_ENV_VAR} environment variable is missing, cannot run tests!') | ||
return token | ||
|
||
|
||
@pytest.fixture | ||
def apify_client(api_token: str) -> ApifyClient: | ||
api_url = os.getenv(API_URL_ENV_VAR) | ||
return ApifyClient(api_token, api_url=api_url) | ||
|
||
|
||
|
@@ -25,11 +40,6 @@ def apify_client() -> ApifyClient: | |
# but `pytest-asyncio` closes the event loop after each test, | ||
# and uses a new one for the next test. | ||
@pytest.fixture | ||
def apify_client_async() -> ApifyClientAsync: | ||
api_token = os.getenv(TOKEN_ENV_VAR) | ||
def apify_client_async(api_token: str) -> ApifyClientAsync: | ||
api_url = os.getenv(API_URL_ENV_VAR) | ||
|
||
if not api_token: | ||
raise RuntimeError(f'{TOKEN_ENV_VAR} environment variable is missing, cannot run tests!') | ||
|
||
return ApifyClientAsync(api_token, api_url=api_url) |
Uh oh!
There was an error while loading. Please reload this page.