def test_sync_query(cloud_config, capsys): query = ('SELECT corpus FROM publicdata:samples.shakespeare ' 'GROUP BY corpus;') main(project_id=cloud_config.project, query=query, timeout=30, num_retries=5) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query_standard_sql(cloud_config, capsys): query = 'SELECT [1, 2, 3] AS arr;' # Only valid in standard SQL main(project_id=cloud_config.project, query=query, timeout=30, num_retries=5, use_legacy_sql=False) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query_standard_sql(cloud_config, capsys): query = 'SELECT [1, 2, 3] AS arr;' # Only valid in standard SQL main( project_id=cloud_config.project, query=query, timeout=30, num_retries=5, use_legacy_sql=False) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query(capsys): query = ('SELECT corpus FROM publicdata:samples.shakespeare ' 'GROUP BY corpus;') main(project_id=PROJECT, query=query, timeout=30, num_retries=5, use_legacy_sql=True) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query(cloud_config, capsys): query = ( 'SELECT corpus FROM publicdata:samples.shakespeare ' 'GROUP BY corpus;') main( project_id=cloud_config.GCLOUD_PROJECT, query=query, timeout=30, num_retries=5) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query_standard_sql(cloud_config, capsys): query = ( 'SELECT corpus FROM publicdata.samples.shakespeare ' 'GROUP BY corpus;') main( project_id=cloud_config.project, query=query, timeout=30, num_retries=5, use_legacy_sql=False) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None
def test_sync_query(capsys): query = ( 'SELECT corpus FROM publicdata:samples.shakespeare ' 'GROUP BY corpus;') main( project_id=PROJECT, query=query, timeout=30, num_retries=5, use_legacy_sql=True) out, _ = capsys.readouterr() result = out.split('\n')[0] assert json.loads(result) is not None