File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ import os
2+ import pytest
3+
4+ from carto .do_token import DoTokenManager
5+
6+
7+ @pytest .fixture (scope = "module" )
8+ def do_token_manager (api_key_auth_client ):
9+ """
10+ Returns a do token manager that can be reused in tests
11+ :param api_key_auth_client: Fixture that provides a valid
12+ APIKeyAuthClient object
13+ :return: DoTokenManager instance
14+ """
15+ return DoTokenManager (api_key_auth_client )
16+
17+
18+ @pytest .mark .skipif ("TRAVIS" in os .environ and os .environ ["TRAVIS" ] == "true" ,
19+ reason = "Integration tests not executed in Travis" )
20+ def test_get_token (do_token_manager ):
21+ """
22+ Get all the datasets from the API
23+ :param do_token_manager: Fixture that provides a do token manager to work with
24+ """
25+ token = do_token_manager .get ()
26+
27+ assert token is not None
28+ assert token .access_token is not None
29+ assert isinstance (token .access_token , str )
30+ assert len (token .access_token ) > 0
You can’t perform that action at this time.
0 commit comments