-
Notifications
You must be signed in to change notification settings - Fork 7
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
10 changed files
with
129 additions
and
46 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
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 |
---|---|---|
|
@@ -18,5 +18,5 @@ | |
"loggers": [ | ||
"ynca" | ||
], | ||
"version": "5.0.0" | ||
"version": "5.1.0" | ||
} |
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,13 +1,17 @@ | ||
from custom_components.yamaha_ynca.helpers import serial_url_from_user_input | ||
from custom_components.yamaha_ynca.helpers import scale | ||
|
||
|
||
def test_serial_url_from_user_input_ip_address_ok(hass): | ||
assert serial_url_from_user_input("1.2.3.4") == "socket://1.2.3.4:50000" | ||
assert serial_url_from_user_input("1.2.3.4:5") == "socket://1.2.3.4:5" | ||
def test_scale(hass): | ||
assert scale(1, [1, 10], [2, 11]) == 2 | ||
|
||
|
||
def test_serial_url_from_user_input_not_an_ip_address(hass): | ||
assert serial_url_from_user_input("not an ip address") == "not an ip address" | ||
assert serial_url_from_user_input("1.2.3.999") == "1.2.3.999" | ||
assert serial_url_from_user_input("1.2.3.4:abcd") == "1.2.3.4:abcd" | ||
assert serial_url_from_user_input("1.2.3.4:5:6") == "1.2.3.4:5:6" | ||
# def test_serial_url_from_user_input_ip_address_ok(hass): | ||
# assert serial_url_from_user_input("1.2.3.4") == "socket://1.2.3.4:50000" | ||
# assert serial_url_from_user_input("1.2.3.4:5") == "socket://1.2.3.4:5" | ||
|
||
|
||
# def test_serial_url_from_user_input_not_an_ip_address(hass): | ||
# assert serial_url_from_user_input("not an ip address") == "not an ip address" | ||
# assert serial_url_from_user_input("1.2.3.999") == "1.2.3.999" | ||
# assert serial_url_from_user_input("1.2.3.4:abcd") == "1.2.3.4:abcd" | ||
# assert serial_url_from_user_input("1.2.3.4:5:6") == "1.2.3.4:5:6" |
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