File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ We have integration tests which build and run Actors using the Python SDK on the
7878you need to set the ` APIFY_TEST_USER_API_TOKEN ` environment variable to the API token of the Apify user you want to
7979use for the tests, and then start them with ` make integration-tests ` .
8080
81+ For subset of integration tests another token is needed ` APIFY_TEST_USER_2_API_TOKEN ` . Such tests are testing
82+ the storage restricted access and thus need two user accounts.
83+
8184If you want to run the integration tests on a different environment than the main Apify Platform, you need to set
8285the ` APIFY_INTEGRATION_TESTS_API_URL ` environment variable to the right URL to the Apify API you want to use.
8386
Original file line number Diff line number Diff line change 1010from apify_client import ApifyClient , ApifyClientAsync
1111
1212TOKEN_ENV_VAR = 'APIFY_TEST_USER_API_TOKEN'
13+ TOKEN_ENV_VAR_2 = 'APIFY_TEST_USER_2_API_TOKEN'
1314API_URL_ENV_VAR = 'APIFY_INTEGRATION_TESTS_API_URL'
1415
1516
@@ -30,15 +31,16 @@ def api_token() -> str:
3031@pytest .fixture (scope = 'session' )
3132def api_token_2 () -> str :
3233 """API token for the second test user for storage permission tests."""
33- second_user_env_var = 'APIFY_TEST_USER_PYTHON_SDK_API_TOKEN'
34- token = os .getenv (second_user_env_var )
34+ token = os .getenv (TOKEN_ENV_VAR_2 )
3535 if not token :
36- raise RuntimeError (f'{ second_user_env_var } environment variable is missing, cannot run permission tests!' )
36+ raise RuntimeError (f'{ TOKEN_ENV_VAR_2 } environment variable is missing, cannot run permission tests!' )
3737 return token
3838
3939
4040@pytest .fixture
4141def apify_client (api_token : str ) -> ApifyClient :
42+ client = ApifyClient (api_token , api_url = os .getenv (API_URL_ENV_VAR ))
43+ raise Exception (client .user ().get ()["id" ])
4244 return ApifyClient (api_token , api_url = os .getenv (API_URL_ENV_VAR ))
4345
4446
You can’t perform that action at this time.
0 commit comments