Ejemplo n.º 1
0
    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"))
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 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))
Ejemplo n.º 5
0
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)
Ejemplo n.º 6
0
 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))
Ejemplo n.º 7
0
 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))
Ejemplo n.º 8
0
 def setUpClass(cls):
     cls.rda = RDA()
     mock_gbdx_session = get_mock_gbdx_session(token='dummytoken')
     cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
Ejemplo n.º 9
0
 def setUpClass(cls):
     mock_gbdx_session = get_mock_gbdx_session(token="dummytoken")
     cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
Ejemplo n.º 10
0
 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)
Ejemplo n.º 11
0
 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))
Ejemplo n.º 12
0
 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)
Ejemplo n.º 13
0
 def setUpClass(cls):
     mock_gbdx_session = get_mock_gbdx_session(token="dummytoken")
     cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)
Ejemplo n.º 14
0
 def setUpClass(cls):
     cls.rda = RDA()
     mock_gbdx_session = get_mock_gbdx_session(token='dummytoken')
     cls.gbdx = Interface(gbdx_connection=mock_gbdx_session)