307514e3a7115c1ce1eb3b2a343607fa5688b8bb,tests/components/notify/test_apns.py,TestApns,test_send_with_state,#TestApns#Any#,314
Before Change
Test updating an existing device.
send = mock_client.return_value.send_notification
devices_path = self.hass.config.path("test_app_apns.yaml")
with open(devices_path, "w+") as out:
out.write("1234: {name: test device 1, "
"tracking_device_id: tracking123}\n")
out.write("5678: {name: test device 2, "
"tracking_device_id: tracking456}\n")
notify_service = apns.ApnsNotificationService(
self.hass,
"test_app",
"testapp.appname",
After Change
Test updating an existing device.
send = mock_client.return_value.send_notification
yaml_file = {
1234: {
"name": "test device 1",
"tracking_device_id": "tracking123",
},
5678: {
"name": "test device 2",
"tracking_device_id": "tracking456",
},
}
with patch(
"homeassistant.components.notify.apns.load_yaml_config_file",
Mock(return_value=yaml_file)), \
patch("os.path.isfile", Mock(return_value=True)):
notify_service = apns.ApnsNotificationService(
self.hass,
"test_app",
"testapp.appname",
False,
"test_app.pem"
)
notify_service.device_state_changed_listener(
"device_tracker.tracking456",
State("device_tracker.tracking456", None),
State("device_tracker.tracking456", "home"))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 14
Instances
Project Name: home-assistant/home-assistant
Commit Name: 307514e3a7115c1ce1eb3b2a343607fa5688b8bb
Time: 2017-03-04
Author: paulus@paulusschoutsen.nl
File Name: tests/components/notify/test_apns.py
Class Name: TestApns
Method Name: test_send_with_state
Project Name: home-assistant/home-assistant
Commit Name: b939626497d2d3a0ef66b777b21a2ed950ada842
Time: 2017-03-04
Author: paulus@paulusschoutsen.nl
File Name: tests/components/notify/test_apns.py
Class Name: TestApns
Method Name: test_send_when_disabled
Project Name: home-assistant/home-assistant
Commit Name: 307514e3a7115c1ce1eb3b2a343607fa5688b8bb
Time: 2017-03-04
Author: paulus@paulusschoutsen.nl
File Name: tests/components/notify/test_apns.py
Class Name: TestApns
Method Name: test_send_with_state
Project Name: home-assistant/home-assistant
Commit Name: b939626497d2d3a0ef66b777b21a2ed950ada842
Time: 2017-03-04
Author: paulus@paulusschoutsen.nl
File Name: tests/components/notify/test_apns.py
Class Name: TestApns
Method Name: test_send