<s> """<STR_LIT>""" <EOL> import mock <EOL> import logging <EOL> from src import basetest <EOL> from src . clients import bigquery <EOL> from src . pipelines . stages import bigqueryoutput <EOL> class BigQueryOutputTest ( basetest . TestCase ) : <EOL> def testRun ( self ) : <EOL> config = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ ] <EOL> } , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] <EOL> } <EOL> mock_bq = mock . MagicMock ( ) <EOL> bigquery . BigQuery . return_value = mock_bq <EOL> mock_bq . CreateDataset . return_value ( None ) <EOL> mock_bq . CreateTable . return_value ( None ) <EOL> with mock . patch . object ( bigquery , <EOL> '<STR_LIT>' , <EOL> return_value = mock_bq ) : <EOL> bqo = bigqueryoutput . BigQueryOutput ( config ) <EOL> bqo . start_test ( ) <EOL> mock_bq . CreateDataset . assert_called_once_with ( '<STR_LIT>' ) <EOL> mock_bq . CreateTable . assert_called_once_with ( '<STR_LIT>' , '<STR_LIT>' , [ ] , <EOL> '<STR_LIT>' , <EOL> source_format = None ) <EOL> def testRunSourceFormat ( self ) : <EOL> config = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ ] <EOL> } , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] <EOL> } <EOL> mock_bq = mock . MagicMock ( ) <EOL> bigquery . BigQuery . return_value = mock_bq <EOL> mock_bq . CreateDataset . return_value ( None ) <EOL> mock_bq . CreateTable . return_value ( None ) <EOL> with mock . patch . object ( bigquery , <EOL> '<STR_LIT>' , <EOL> return_value = mock_bq ) : <EOL> bqo = bigqueryoutput . BigQueryOutput ( config ) <EOL> bqo . start_test ( ) <EOL> mock_bq . CreateDataset . assert_called_once_with ( '<STR_LIT>' ) <EOL> mock_bq . CreateTable . assert_called_once_with ( <EOL> '<STR_LIT>' , '<STR_LIT>' , [ ] , '<STR_LIT>' , <EOL> source_format = '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> basetest . main ( ) </s>
