def testNoProject(self):
     instance = publisher.BigQueryPublisher(self.table)
     instance.PublishSamples(self.samples)
     self.mock_vm_util.IssueRetryableCommand.assert_called_once_with([
         'bq', 'load', '--autodetect',
         '--source_format=NEWLINE_DELIMITED_JSON', self.table, mock.ANY
     ])
 def testServiceAccountFlags_BothSpecified(self):
   instance = publisher.BigQueryPublisher(
       self.table,
       service_account=mock.MagicMock(),
       service_account_private_key_file=mock.MagicMock())
   instance.PublishSamples(self.samples)  # No error
   self.mock_vm_util.IssueRetryableCommand.assert_called_once_with(mock.ANY)
 def testNoSamples(self):
     instance = publisher.BigQueryPublisher(self.table)
     instance.PublishSamples([])
     self.assertEqual([],
                      self.mock_vm_util.IssueRetryableCommand.mock_calls)
Example #4
0
 def testApplicationCredentialsFlag_WorkingNormal(self):
     instance = publisher.BigQueryPublisher(
         self.table, application_default_credential_file=mock.MagicMock())
     instance.PublishSamples(self.samples)  # No error
     self.mock_vm_util.IssueRetryableCommand.assert_called_once_with(
         mock.ANY)