Skip to content

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

Merged
tswast merged 1 commit intogoogleapis:masterfrom
plamut:iss-8719
Jul 22, 2019
Merged

BigQuery: Mock external calls in one of BigQuery unit tests#8727
tswast merged 1 commit intogoogleapis:masterfrom
plamut:iss-8719

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 a team and tseaver 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