1#!/usr/bin/env python3 2# 3# Copyright (C) 2018 The Android Open Source Project 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); you may not 6# use this file except in compliance with the License. You may obtain a copy of 7# the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14# License for the specific language governing permissions and limitations under 15# the License. 16"""Tests for bigquery_logger.""" 17 18import acts.controllers.buds_lib.data_storage.bigquery.bigquery_logger 19 20logger = bigquery_logger.BigqueryLogger(dataset_id='test', table_id='test') 21 22 23def test_with_block(): 24 with bigquery_logger.BigqueryLogger('with_block_test', 25 'test_table') as log: 26 log.add_row({'NEW': 'nice', 'FIELD6': 3.0, 'noodle': 3}) 27 log.add_row({'FIELD2': 12, 'FIELD3': True, 'SUPERNEW': 'stroong'}) 28