Exemplo n.º 1
0
 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
Exemplo n.º 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