コード例 #1
0
ファイル: bootstrap_test.py プロジェクト: a2call/test-infra
 def testUploadJson(self):
     gsutil = bootstrap.GSUtil()
     with Stub(bootstrap, 'call', FakeSubprocess()) as fake:
         gsutil.upload_json('fake_path', {'wee': 'fun'})
     self.assertTrue(any(
         'application/json' in a for a in fake.calls[0][0]))
     self.assertIn('stdin', fake.calls[0][2])  # kwargs
コード例 #2
0
 def testUploadText_Uncached(self):
     gsutil = bootstrap.GSUtil()
     with Stub(bootstrap, 'call', FakeSubprocess()) as fake:
         gsutil.upload_text('fake_path', 'hello world', cached=False)
     self.assertTrue(
         any('Cache-Control' in a and 'max-age' in a
             for a in fake.calls[0][0]))
     self.assertIn('stdin', fake.calls[0][2])  # kwargs