Skip to content

Commit

Permalink
More typing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed May 14, 2021
1 parent 088938f commit c6b6669
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion haphilipsjs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,7 +692,8 @@ async def getChannels(self):
r = await self.getChannelList(list_id)
if r:
for channel in r:
self.channels[str(channel["ccid"])] = channel
if "ccid" in channel:
self.channels[str(channel["ccid"])] = channel
return r
else:
r = cast(Optional[ChannelsType], await self.getReq("channels"))
Expand Down
4 changes: 2 additions & 2 deletions tests/test_v6.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def client_mock(loop, param: Param):
respx.get(f"{param.base}/activities/current").respond(
json=cast(Dict, ACTIVITIES_CURRENT)
)
respx.get(f"{param.base}/activities/tv").respond(json=ACTIVITIES_TV)
respx.get(f"{param.base}/activities/tv").respond(json=cast(Dict, ACTIVITIES_TV))
respx.get(f"{param.base}/applications").respond(json=cast(Dict, APPLICATIONS))
respx.get(f"{param.base}/powerstate").respond(json=POWERSTATE)
respx.get(f"{param.base}/screenstate").respond(json=SCREENSTATE)
Expand Down Expand Up @@ -135,7 +135,7 @@ async def test_basic_data(client_mock, param: Param):
assert client_mock.system == SYSTEM_ANDROID_DECRYPTED
assert client_mock.sources == MOCK_ANDROID_SOURCES
assert client_mock.applications == {
app["id"]: app for app in APPLICATIONS["applications"]
app["id"]: app for app in APPLICATIONS["applications"] if "id" in app
}
assert (
client_mock.application_id
Expand Down

0 comments on commit c6b6669

Please sign in to comment.