diff --git a/qiskit_quantuminspire/qi_provider.py b/qiskit_quantuminspire/qi_provider.py index ec185d2..8b1e70b 100644 --- a/qiskit_quantuminspire/qi_provider.py +++ b/qiskit_quantuminspire/qi_provider.py @@ -12,9 +12,9 @@ class QIProvider: def __init__(self) -> None: self._qiskit_backends = self._construct_backends() - def _fetch_qi_backend_metadata(self) -> List[Metadata]: + def _fetch_qi_backend_metadata(self, backend_type: BackendType) -> Metadata: """Fetch backend metadata using api client.""" - return [Metadata(id=1, backend_id=1, created_on=datetime.now(timezone.utc), data={"nqubits": 6})] + return Metadata(id=1, backend_id=1, created_on=datetime.now(timezone.utc), data={"nqubits": 6}) def _fetch_qi_backend_types(self) -> List[BackendType]: """Fetch backend types from CJM using api client.""" @@ -39,15 +39,14 @@ def _fetch_qi_backend_types(self) -> List[BackendType]: def _construct_backends(self) -> List[QIBackend]: """Construct QIBackend using fetched backendtypes and metadata.""" qi_backend_types = self._fetch_qi_backend_types() - qi_metadata = self._fetch_qi_backend_metadata() qi_backends = [ - QIBackend(provider=self, backend_type=backend_type, metadata=metadata) - for backend_type, metadata in zip(qi_backend_types, qi_metadata) + QIBackend(provider=self, backend_type=backend_type, metadata=self._fetch_qi_backend_metadata(backend_type)) + for backend_type in qi_backend_types ] return qi_backends def backends(self, name: Union[str, None] = None, **kwargs: Any) -> List[QIBackend]: - return self._construct_backends() + return self._qiskit_backends def get_backend(self, name: Union[str, None] = None, **kwargs: Any) -> QIBackend: - return self._construct_backends()[0] + return self._qiskit_backends[0] diff --git a/tests/test_main.py b/tests/test_main.py index 0c50472..6f65ede 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -5,10 +5,6 @@ from qiskit_quantuminspire.qi_provider import QIProvider -def test_dummy() -> None: - assert True - - def test_flow() -> None: provider = QIProvider() backend = provider.get_backend("Some-Backend")