Skip to content

Commit

Permalink
Remove cloud config fixture [(googleapis#887)](GoogleCloudPlatform/py…
Browse files Browse the repository at this point in the history
…thon-docs-samples#887)

* Remove cloud config fixture

* Fix client secrets

* Fix bigtable instance
  • Loading branch information
Jon Wayne Parrott authored and dpebot committed Apr 4, 2017
1 parent a0837f9 commit b1b1f59
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion samples/snippets/async_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from async_query import async_query


def test_async_query(cloud_config, capsys):
def test_async_query(capsys):
query = (
'SELECT corpus FROM `publicdata.samples.shakespeare` '
'GROUP BY corpus;')
Expand Down
9 changes: 5 additions & 4 deletions samples/snippets/export_data_to_gcs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import export_data_to_gcs
import os

import export_data_to_gcs

BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
DATASET_ID = 'test_dataset'
TABLE_ID = 'test_table'


def test_export_data_to_gcs(cloud_config, capsys):
def test_export_data_to_gcs(capsys):
export_data_to_gcs.export_data_to_gcs(
DATASET_ID,
TABLE_ID,
'gs://{}/test-export-data-to-gcs.csv'.format(
cloud_config.storage_bucket))
'gs://{}/test-export-data-to-gcs.csv'.format(BUCKET))

out, _ = capsys.readouterr()

Expand Down
8 changes: 5 additions & 3 deletions samples/snippets/load_data_from_gcs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

import load_data_from_gcs

BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
DATASET_ID = 'test_dataset'
TABLE_ID = 'test_import_table'


def test_load_table(cloud_config, capsys):
cloud_storage_input_uri = 'gs://{}/data.csv'.format(
cloud_config.storage_bucket)
def test_load_table(capsys):
cloud_storage_input_uri = 'gs://{}/data.csv'.format(BUCKET)

load_data_from_gcs.load_data_from_gcs(
DATASET_ID,
Expand Down
4 changes: 2 additions & 2 deletions samples/snippets/sync_query_params_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
import sync_query_params


def test_sync_query_named_params(cloud_config, capsys):
def test_sync_query_named_params(capsys):
sync_query_params.sync_query_named_params(
corpus='romeoandjuliet',
min_word_count=100)
out, _ = capsys.readouterr()
assert 'love' in out


def test_sync_query_positional_params(cloud_config, capsys):
def test_sync_query_positional_params(capsys):
sync_query_params.sync_query_positional_params(
corpus='romeoandjuliet',
min_word_count=100)
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/sync_query_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from sync_query import sync_query


def test_sync_query(cloud_config, capsys):
def test_sync_query(capsys):
query = (
'SELECT corpus FROM `publicdata.samples.shakespeare` '
'GROUP BY corpus;')
Expand Down

0 comments on commit b1b1f59

Please sign in to comment.