-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
191 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Constants for tests.""" | ||
|
||
with open("tests/fixtures/event_ms_channel_connect.json") as file: | ||
MS_CHANNEL_CONNECT_SAMPLE = file.read() | ||
with open("tests/fixtures/event_ed_edentv_update.json") as file: | ||
ED_EDENTV_UPDATE_SAMPLE = file.read() | ||
with open("tests/fixtures/event_ed_apps_launch.json") as file: | ||
ED_APPS_LAUNCH_SAMPLE = file.read() | ||
with open("tests/fixtures/event_ed_installedApp_get.json") as file: | ||
ED_INSTALLED_APP_SAMPLE = file.read() | ||
with open("tests/fixtures/event_ms_error.json") as file: | ||
MS_ERROR_SAMPLE = file.read() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"data": 200, | ||
"event": "ed.apps.launch", | ||
"from": "host" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"data": { | ||
"update_type": "ed.edenApp.update" | ||
}, | ||
"event": "ed.edenTV.update" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"data": { | ||
"token": 123456789 | ||
}, | ||
"event": "ms.channel.connect", | ||
"from": "host" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
"""Tests for helper module.""" | ||
from samsungtvws.helper import process_api_response | ||
|
||
from .const import ED_APPS_LAUNCH_SAMPLE | ||
|
||
|
||
def test_data_simple() -> None: | ||
"""Ensure simple data can be parsed.""" | ||
data = '{"data": 200, "event": "ed.apps.launch", "from": "host"}' | ||
|
||
parsed_response = process_api_response(data) | ||
parsed_response = process_api_response(ED_APPS_LAUNCH_SAMPLE) | ||
assert parsed_response == {"data": 200, "event": "ed.apps.launch", "from": "host"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters