Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 605b69d

Browse files
Cleanup bigtable python examples [(#2692)](GoogleCloudPlatform/python-docs-samples#2692)
* Cleanup bigtable python: Use new row types for mutations Update bigtable version in requirements Delete table after tests * Change bigtable cluster variable to bigtable instance for consistency Create and delete quickstart table during test * Fixing step size for metric scaler Create unique tables for quickstart tests * Creating fixtures for quickstart tests Fixing hb quickstart test output * Fix quickstart extra delete table Update happybase to use direct row * Use clearer instance names for tests Create unique instances for metric scaler tests * Linting * remove core dep Co-authored-by: Leah E. Cole <[email protected]>
1 parent cddd38f commit 605b69d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-bigtable==1.2.0
1+
google-cloud-bigtable==1.2.1

samples/tableadmin/tableadmin_test.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121
from tableadmin import run_table_operations
2222

2323
PROJECT = os.environ['GCLOUD_PROJECT']
24-
BIGTABLE_CLUSTER = os.environ['BIGTABLE_CLUSTER']
25-
TABLE_NAME_FORMAT = 'hello-bigtable-system-tests-{}'
24+
BIGTABLE_INSTANCE = os.environ['BIGTABLE_INSTANCE']
25+
TABLE_NAME_FORMAT = 'tableadmin-test-{}'
2626
TABLE_NAME_RANGE = 10000
2727

2828

2929
def test_run_table_operations(capsys):
3030
table_name = TABLE_NAME_FORMAT.format(
3131
random.randrange(TABLE_NAME_RANGE))
3232

33-
run_table_operations(PROJECT, BIGTABLE_CLUSTER, table_name)
33+
run_table_operations(PROJECT, BIGTABLE_INSTANCE, table_name)
3434
out, _ = capsys.readouterr()
3535

3636
assert 'Creating the ' + table_name + ' table.' in out
@@ -50,13 +50,15 @@ def test_run_table_operations(capsys):
5050
assert 'Delete a column family cf2...' in out
5151
assert 'Column family cf2 deleted successfully.' in out
5252

53+
delete_table(PROJECT, BIGTABLE_INSTANCE, table_name)
54+
5355

5456
def test_delete_table(capsys):
5557
table_name = TABLE_NAME_FORMAT.format(
5658
random.randrange(TABLE_NAME_RANGE))
57-
create_table(PROJECT, BIGTABLE_CLUSTER, table_name)
59+
create_table(PROJECT, BIGTABLE_INSTANCE, table_name)
5860

59-
delete_table(PROJECT, BIGTABLE_CLUSTER, table_name)
61+
delete_table(PROJECT, BIGTABLE_INSTANCE, table_name)
6062
out, _ = capsys.readouterr()
6163

6264
assert 'Table ' + table_name + ' exists.' in out

0 commit comments

Comments
 (0)