def test_repeat_create_table(self, gcon): param = table_schema_factory() gcon.create_table(param) res = gcon.create_table(param) LOGGER.error(res) assert not res.OK()
def test_has_table(self, gcon): param = table_schema_factory() s = gcon.create_table(param) assert s.OK() status, flag = gcon.has_table(param['table_name']) assert status.OK() assert flag
def test_describe_table_normal(self, gcon): param = table_schema_factory() gcon.create_table(param) status, table = gcon.describe_table(param['table_name']) assert status.OK() assert table.table_name == param['table_name'] status, table = gcon.describe_table('table_not_exists') assert not status.OK()
def test_drop_table_normal(self, gcon): param = table_schema_factory() s = gcon.create_table(param) assert s.OK() time.sleep(5) _, tables = gcon.show_tables() assert param['table_name'] in tables status = gcon.drop_table(param['table_name']) _, tables = gcon.show_tables() assert param['table_name'] not in tables
def test_create_table(self, gcon): param = table_schema_factory() param['table_name'] = None with pytest.raises(ParamError): gcon.create_table(param) param = table_schema_factory() res = gcon.create_table(param) assert res.OK() assert gcon.has_table(param['table_name']) param = table_schema_factory() param['dimension'] = 'string' with pytest.raises(ParamError): res = gcon.create_table(param) param = '09998876565' with pytest.raises(ParamError): gcon.create_table(param) param = table_schema_factory() param['table_name'] = 1234456 with pytest.raises(ParamError): gcon.create_table(param)
def test_create_table_name_wrong(self, gcon): param = table_schema_factory() param['table_name'] = '.....' status = gcon.create_table(param) LOGGER.error(status) assert not status.OK()
def test_create_table_normal(self, gcon): param = table_schema_factory() status = gcon.create_table(param) assert status.OK()