示例#1
0
    def test_current(self):
        from gcloud.storage.client import Client
        project = 'PROJECT'
        credentials = _Credentials()
        client = Client(project=project, credentials=credentials)
        batch1 = self._makeOne(client)
        self.assertTrue(batch1.current() is None)

        client._push_batch(batch1)
        self.assertTrue(batch1.current() is batch1)

        batch2 = self._makeOne(client)
        client._push_batch(batch2)
        self.assertTrue(batch1.current() is batch2)
示例#2
0
    def test_current(self):
        from gcloud.storage.client import Client
        project = 'PROJECT'
        credentials = _Credentials()
        client = Client(project=project, credentials=credentials)
        batch1 = self._makeOne(client)
        self.assertTrue(batch1.current() is None)

        client._push_batch(batch1)
        self.assertTrue(batch1.current() is batch1)

        batch2 = self._makeOne(client)
        client._push_batch(batch2)
        self.assertTrue(batch1.current() is batch2)