-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix string validation on amazon forwards config (#946)
* fix: fix string validation on amazon forwards config * clean up commented code
- Loading branch information
Showing
5 changed files
with
21 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,7 @@ | |
"gif_duration": 5, | ||
"host": "imap.test.email", | ||
"image_name": "mail_today.gif", | ||
"image_path": "/config/www/mail_and_packages/", | ||
"image_path": "custom_components/mail_and_packages/images/", | ||
"image_security": True, | ||
"imap_security": "SSL", | ||
"imap_timeout": 30, | ||
|
@@ -256,7 +256,7 @@ | |
"allow_external": False, | ||
"amazon_days": 3, | ||
"amazon_domain": "amazon.com", | ||
"amazon_fwds": ["[email protected]", "[email protected]"], | ||
"amazon_fwds": "[email protected], [email protected]", | ||
"custom_img": False, | ||
"folder": '"INBOX"', | ||
"generate_mp4": False, | ||
|
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,8 +1,7 @@ | ||
""" Test Mail and Packages config flow """ | ||
|
||
from unittest.mock import patch | ||
|
||
import logging | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
from homeassistant import config_entries, setup | ||
|
@@ -89,7 +88,7 @@ | |
"allow_external": False, | ||
"amazon_days": 3, | ||
"amazon_domain": "amazon.com", | ||
"amazon_fwds": ["[email protected]", "[email protected]"], | ||
"amazon_fwds": "[email protected],[email protected]", | ||
"custom_img": True, | ||
"custom_img_file": "images/test.gif", | ||
"host": "imap.test.email", | ||
|
@@ -1598,7 +1597,7 @@ async def test_form_amazon_error( | |
"allow_external": False, | ||
"amazon_days": 3, | ||
"amazon_domain": "amazon.com", | ||
"amazon_fwds": ["[email protected]", "[email protected]"], | ||
"amazon_fwds": "[email protected],[email protected]", | ||
"custom_img": True, | ||
"custom_img_file": "images/test.gif", | ||
"host": "imap.test.email", | ||
|
@@ -1778,7 +1777,7 @@ async def test_reconfigure( | |
"allow_external": False, | ||
"amazon_days": 3, | ||
"amazon_domain": "amazon.com", | ||
"amazon_fwds": ["[email protected]", "[email protected]"], | ||
"amazon_fwds": "[email protected], [email protected]", | ||
"custom_img": True, | ||
"custom_img_file": "images/test.gif", | ||
"host": "imap.test.email", | ||
|
@@ -1943,7 +1942,7 @@ async def test_reconfigure_no_amazon( | |
"allow_external": False, | ||
"amazon_days": 3, | ||
"amazon_domain": "amazon.com", | ||
"amazon_fwds": ["[email protected]", "[email protected]"], | ||
"amazon_fwds": "[email protected], [email protected]", | ||
"custom_img": False, | ||
"host": "imap.test.email", | ||
"port": 993, | ||
|
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 |
---|---|---|
|
@@ -799,7 +799,10 @@ async def test_amazon_search_delivered( | |
result = amazon_search( | ||
mock_imap_amazon_delivered, "test/path", hass, "testfilename.jpg", "amazon.com" | ||
) | ||
assert "Amazon email search address: ['[email protected]', '[email protected]']" in caplog.text | ||
assert ( | ||
"Amazon email search address: ['[email protected]', '[email protected]']" | ||
in caplog.text | ||
) | ||
assert result == 7 | ||
assert mock_download_img.called | ||
|
||
|