Skip to content

Commit

Permalink
Fix invalid argument in list_processors. (#2899)
Browse files Browse the repository at this point in the history
* Fix invalid argument in list_processors.

* Fix formatting.
  • Loading branch information
95-martin-orion committed Apr 9, 2020
1 parent b1b09a0 commit baa718e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cirq/google/engine/engine_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,9 @@ def list_processors(self, project_id: str) -> List[qtypes.QuantumProcessor]:
Returns:
A list of metadata of each processor.
"""
response = self._make_request(lambda: self.grpc_client.
list_quantum_processors(
self._project_name(project_id), ''))
response = self._make_request(
lambda: self.grpc_client.list_quantum_processors(
self._project_name(project_id), filter_=''))
return list(response)

def get_processor(self, project_id: str,
Expand Down
8 changes: 6 additions & 2 deletions cirq/google/engine/engine_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from cirq.google.engine.client.quantum_v1alpha1 import enums as qenums
from cirq.google.engine.client.quantum_v1alpha1 import types as qtypes


def setup_mock_(client_constructor):
grpc_client = mock.Mock()
client_constructor.return_value = grpc_client
Expand Down Expand Up @@ -557,8 +558,11 @@ def test_list_processors(client_constructor):

client = EngineClient()
assert client.list_processors('proj') == results
assert grpc_client.list_quantum_processors.call_args[0] == ('projects/proj',
'')
assert grpc_client.list_quantum_processors.call_args[0] == (
'projects/proj',)
assert grpc_client.list_quantum_processors.call_args[1] == {
'filter_': '',
}


@mock.patch.object(quantum, 'QuantumEngineServiceClient', autospec=True)
Expand Down

0 comments on commit baa718e

Please sign in to comment.