Exemplo n.º 1
0
def test_query_bucket(requests_mock, fixture_valid_region,
                      fixture_valid_instance_id):
    fixture_valid_instance_id.return_value = 'i-123t32e11s32t1231'
    fixture_valid_region.return_value = 'us-east-1'
    requests_mock.get((
        'https://aws-deep-learning-containers-us-east-1.s3.us-east-1.amazonaws.com'
        '/dlc-containers.txt?x-instance-id=i-123t32e11s32t1231'),
                      text='Access Denied')
    actual_response = deep_learning_container_to_test.query_bucket()
    assert 'Access Denied' == actual_response.text
Exemplo n.º 2
0
def test_query_bucket_instance_id_none(requests_mock, fixture_valid_region,
                                       fixture_none_instance_id):
    fixture_none_instance_id.return_value = None
    fixture_valid_region.return_value = 'us-east-1'
    actual_response = deep_learning_container_to_test.query_bucket()
    assert actual_response is None
Exemplo n.º 3
0
def test_query_bucket_region_none(fixture_invalid_region,
                                  fixture_valid_instance_id):
    fixture_valid_instance_id.return_value = 'i-123t32e11s32t1231'
    fixture_invalid_region.return_value = None
    actual_response = deep_learning_container_to_test.query_bucket()
    assert actual_response is None