def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) # setup mock data paths cls.data_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), "data"))
def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) cls.data_path = os.path.abspath( os.path.join(os.path.dirname(os.path.realpath(__file__)), "data"))
def setUpClass(cls): token = {"token_type": "Bearer", "refresh_token": "dummyToken", "access_token": "dummytoken", "scope": ["read", "write"], "expires_in": 604800, "expires_at": 2529702305} mock_gbdx_session = get_mock_gbdx_session(token=token) cls.gbdx = Interface(gbdx_connection=mock_gbdx_session, config_file=temp.name)
def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) #cls.gbdx = Interface() cls._temp_path = tempfile.mkdtemp() print("Created: {}".format(cls._temp_path))
from gbdxtools import Interface from auth_mock import get_mock_gbdx_session """ How to use the mock_gbdx_session and vcr to create unit tests: 1. Add a new test that is dependent upon actually hitting GBDX APIs. 2. Decorate the test with @vcr appropriately, supply a yaml file path to gbdxtools/tests/unit/cassettes note: a yaml file will be created after the test is run 3. Replace "dummytoken" with a real gbdx token after running test successfully 4. Run the tests (existing test shouldn't be affected by use of a real token). This will record a "cassette". 5. Replace the real gbdx token with "dummytoken" again 6. Edit the cassette to remove any possibly sensitive information (s3 creds for example) """ mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") def test_init(): gi = Interface(gbdx_connection=mock_gbdx_session) assert isinstance(gi, Interface)
def setUpClass(cls): mock_gbdx_session = get_mock_gbdx_session(token='dymmytoken') cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) cls._temp_path = tempfile.mkdtemp() print("Created: {}".format(cls._temp_path))
def setUpClass(cls): mock_gbdx_session = get_mock_gbdx_session(token='dymmytoken') cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) #cls.gbdx = Interface() cls._temp_path = tempfile.mkdtemp() print("Created: {}".format(cls._temp_path))
def setUpClass(cls): cls.rda = RDA() mock_gbdx_session = get_mock_gbdx_session(token='dummytoken') cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
def setUpClass(cls): mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session) cls._temp_path = tempfile.mkdtemp() print("Created: {}".format(cls._temp_path))
def setUpClass(cls): # create mock session, replace dummytoken with real token to create cassette mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
def setUpClass(cls): mock_gbdx_session = get_mock_gbdx_session(token="dummytoken") cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
def setUpClass(cls): cls.rda = RDA() mock_gbdx_session = get_mock_gbdx_session(token='dummytoken') cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)