Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery: Mock external calls in one of BigQuery unit tests #8727

Merged
merged 1 commit into from
Jul 22, 2019

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Jul 22, 2019

Closes #8719

This PR properly mocks external calls in one of the tests.

How to test

  1. Clear environment credentials config:
    $ unset GOOGLE_APPLICATION_CREDENTIALS
  2. Run bigquery unit tests, check the result of test_bigquery_magic_w_maximum_bytes_billed_invalid.

Actual result (before the fix):
The test fails with DefaultCredentialsError.

Expected result (after the fix):
The code under tests raises ValueError as expected, and the test passes.

@plamut plamut added the api: bigquery Issues related to the BigQuery API. label Jul 22, 2019
@plamut plamut requested review from tseaver and a team July 22, 2019 10:48
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 22, 2019
@plamut
Copy link
Contributor Author

plamut commented Jul 22, 2019

FWIW, one of the unrelated BigQuery unit tests will probably still fail, which is addressed in the scope of #8713.

@tswast
Copy link
Contributor

tswast commented Jul 22, 2019

I merged #8713. We should update sync this with master to be safe before merging.

@plamut
Copy link
Contributor Author

plamut commented Jul 22, 2019

Rebased on top of the latest master which now includes the fix for the failing test.

@tswast tswast merged commit 5bc8505 into googleapis:master Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQuery: 'test_bigquery_magic_w_maximum_bytes_billed_invalid' test uses real client.
4 participants