def testIsGCEServerNotFound(self): self.mock_http.request(oauth2_client.METADATA_SERVER).AndRaise( httplib2.ServerNotFoundError) self.mox.ReplayAll() self.assertFalse(oauth2_client._IsGCE()) self.mox.VerifyAll()
def testIsGCETrue(self): self.mock_http.request(oauth2_client.METADATA_SERVER).AndReturn(( FakeResponse(200), '')) self.mox.ReplayAll() self.assertTrue(oauth2_client._IsGCE()) self.mox.VerifyAll()
def testIsGCENotFound(self): self.mock_http.request(oauth2_client.METADATA_SERVER).AndReturn(( FakeResponse(404), '')) self.mox.ReplayAll() self.assertFalse(oauth2_client._IsGCE()) self.mox.VerifyAll()