Exemple #1
0
def test_run_table_operations(capsys):
    table_name = TABLE_NAME_FORMAT.format(
        random.randrange(TABLE_NAME_RANGE))

    run_table_operations(PROJECT, BIGTABLE_INSTANCE, table_name)
    out, _ = capsys.readouterr()

    assert 'Creating the ' + table_name + ' table.' in out
    assert 'Listing tables in current project.' in out
    assert 'Creating column family cf1 with with MaxAge GC Rule' in out
    assert 'Created column family cf1 with MaxAge GC Rule.' in out
    assert 'Created column family cf2 with Max Versions GC Rule.' in out
    assert 'Created column family cf3 with Union GC rule' in out
    assert 'Created column family cf4 with Intersection GC rule.' in out
    assert 'Created column family cf5 with a Nested GC rule.' in out
    assert 'Printing Column Family and GC Rule for all column families.' in out
    assert 'Updating column family cf1 GC rule...' in out
    assert 'Updated column family cf1 GC rule' in out
    assert 'Print column family cf1 GC rule after update...' in out
    assert 'Column Family: cf1' in out
    assert 'max_num_versions: 1' in out
    assert 'Delete a column family cf2...' in out
    assert 'Column family cf2 deleted successfully.' in out

    delete_table(PROJECT, BIGTABLE_INSTANCE, table_name)
def test_delete_table(capsys):
    table_name = TABLE_NAME_FORMAT.format(random.randrange(TABLE_NAME_RANGE))

    delete_table(PROJECT, BIGTABLE_CLUSTER, table_name)
    out, _ = capsys.readouterr()

    assert 'Table ' + table_name + ' exists.' in out
    assert 'Deleting ' + table_name + ' table.' in out
    assert 'Deleted ' + table_name + ' table.' in out
def test_delete_table(capsys):
    table_name = TABLE_NAME_FORMAT.format(
        random.randrange(TABLE_NAME_RANGE))

    delete_table(PROJECT, BIGTABLE_CLUSTER, table_name)
    out, _ = capsys.readouterr()

    assert 'Table ' + table_name + ' exists.' in out
    assert 'Deleting ' + table_name + ' table.' in out
    assert 'Deleted ' + table_name + ' table.' in out
def test_delete_table(capsys):
    table_id = TABLE_ID_FORMAT.format(uuid.uuid4().hex[:8])
    create_table(PROJECT, BIGTABLE_INSTANCE, table_id)

    delete_table(PROJECT, BIGTABLE_INSTANCE, table_id)
    out, _ = capsys.readouterr()

    assert 'Table ' + table_id + ' exists.' in out
    assert 'Deleting ' + table_id + ' table.' in out
    assert 'Deleted ' + table_id + ' table.' in out
def test_delete_table(capsys):
    table_name = TABLE_NAME_FORMAT.format(random.randrange(TABLE_NAME_RANGE))
    create_table(PROJECT, BIGTABLE_CLUSTER, table_name)

    delete_table(PROJECT, BIGTABLE_CLUSTER, table_name)
    out, _ = capsys.readouterr()

    if 'Table ' + table_name + ' exists.' not in out:
        raise AssertionError
    if 'Deleting ' + table_name + ' table.' not in out:
        raise AssertionError
    if 'Deleted ' + table_name + ' table.' not in out:
        raise AssertionError