Beispiel #1
0
def test_delete_bucket_raises(mock_client):

    mock_client.get_bucket.side_effect = NotFound('error')

    gs = GCS(bucket='foo', gc_credentials_file='foo/bar')
    with pytest.raises(GCSDestinationError):
        gs.delete_bucket()
Beispiel #2
0
def test_delete_bucket(mock_client, force):

    mock_bucket = mock.Mock()
    mock_client.get_bucket.return_value = mock_bucket

    gs = GCS(bucket='foo', gc_credentials_file='foo/bar')
    gs.delete_bucket(force=force)
    mock_bucket.delete.assert_called_once_with(force=force)
Beispiel #3
0
def test_delete_bucket_raises(mock_client):

    mock_client.get_bucket.side_effect = NotFound('error')

    gs = GCS(
        bucket='foo',
        gc_credentials_file='foo/bar'
    )
    with pytest.raises(GCSDestinationError):
        gs.delete_bucket()
Beispiel #4
0
def test_delete_bucket(mock_client, force):

    mock_bucket = mock.Mock()
    mock_client.get_bucket.return_value = mock_bucket

    gs = GCS(
        bucket='foo',
        gc_credentials_file='foo/bar'
    )
    gs.delete_bucket(force=force)
    mock_bucket.delete.assert_called_once_with(
        force=force
    )