Example #1
0
 def raise_exception(limit=None,
                     order_by=None,
                     sql_query=None,
                     add_geom=None,
                     is_geography=None):
     raise ServerErrorException(
         ['The user does not have Data Observatory enabled'])
Example #2
0
    def test_dataset_download_without_do_enabled(self, mocked_bq_client, get_by_id_mock, get_all_mock):
        # Given
        get_by_id_mock.return_value = test_dataset1
        dataset = Dataset.get(test_dataset1.id)
        get_all_mock.return_value = []
        mocked_bq_client.return_value = BigQueryClientMock(
            ServerErrorException(['The user does not have Data Observatory enabled'])
        )
        credentials = Credentials('fake_user', '1234')

        # When
        with pytest.raises(Exception) as e:
            dataset.to_csv('fake_path', credentials)

        # Then
        assert str(e.value) == (
            'We are sorry, the Data Observatory is not enabled for your account yet. '
            'Please contact your customer success manager or send an email to '
            '[email protected] to request access to it.')
Example #3
0
 def raise_exception(a, b, c):
     raise ServerErrorException(
         ['The user does not have Data Observatory enabled'])