Skip to content

Commit

Permalink
Fix lint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rathishcholarajan committed Jan 13, 2022
1 parent 71e2762 commit 2fb93f2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion qiskit_ibm_runtime/api/clients/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def user_urls(self) -> Dict[str, str]:
response = self.auth_api.user_info()
return response["urls"]

def user_hubs(self) -> List[Dict[str, str]]:
def user_hubs(self) -> List[Dict[str, Any]]:
"""Retrieve the hub/group/project sets available to the user.
The first entry in the list will be the default set, as indicated by
Expand Down
4 changes: 2 additions & 2 deletions qiskit_ibm_runtime/ibm_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ def _initialize_hgps(
proxies=self._account.proxies,
verify=self._account.verify,
)

backend_names = hub_info["backend_names"]
# Build the hgp.
try:
hgp = HubGroupProject(
client_params=hgp_params,
instance=hgp_params.instance,
backend_names=hub_info["backend_names"],
backend_names=backend_names,
)
hgps[hgp.name] = hgp
except Exception: # pylint: disable=broad-except
Expand Down
13 changes: 6 additions & 7 deletions test/mock/fake_runtime_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,16 @@ def _initialize_hgps(
url="some_url",
instance=hgp_name,
)
hgp = HubGroupProject(client_params=hgp_params, instance=hgp_name)
unique_backend = self.DEFAULT_UNIQUE_BACKEND_PREFIX + str(idx)
backend_names = [self.DEFAULT_COMMON_BACKEND, unique_backend]
hgp = HubGroupProject(
client_params=hgp_params, instance=hgp_name, backend_names=backend_names
)
fake_account_client = self._fake_account_client
if not fake_account_client:
specs = [
{"configuration": {"backend_name": self.DEFAULT_COMMON_BACKEND}},
{
"configuration": {
"backend_name": self.DEFAULT_UNIQUE_BACKEND_PREFIX
+ str(idx)
}
},
{"configuration": {"backend_name": unique_backend}},
]
fake_account_client = BaseFakeAccountClient(specs=specs, hgp=hgp_name)
hgp._api_client = fake_account_client
Expand Down

0 comments on commit 2fb93f2

Please sign in to comment.