d5813cf167dc4899e241c823d71243375c5d40c4,tests/components/sensor/test_rest.py,TestRestSensorSetup,test_setup_failed_connect,#TestRestSensorSetup#Any#,46

Before Change


           side_effect=requests.exceptions.ConnectionError())
    def test_setup_failed_connect(self, mock_req):
        Test setup when connection error occurs.
        self.assertTrue(rest.setup_platform(self.hass, {
            "platform": "rest",
            "resource": "http://localhost",
        }, lambda devices, update=True: None) is None)

    @patch("requests.Session.send", side_effect=Timeout())
    def test_setup_timeout(self, mock_req):
        Test setup when connection timeout occurs.

After Change


           side_effect=requests.exceptions.ConnectionError())
    def test_setup_failed_connect(self, mock_req):
        Test setup when connection error occurs.
        with raises(PlatformNotReady):
            rest.setup_platform(self.hass, {
                "platform": "rest",
                "resource": "http://localhost",
            }, lambda devices, update=True: None)

    @patch("requests.Session.send", side_effect=Timeout())
    def test_setup_timeout(self, mock_req):
        Test setup when connection timeout occurs.
        with raises(PlatformNotReady):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: d5813cf167dc4899e241c823d71243375c5d40c4
Time: 2018-09-21
Author: exxamalte@users.noreply.github.com
File Name: tests/components/sensor/test_rest.py
Class Name: TestRestSensorSetup
Method Name: test_setup_failed_connect


Project Name: home-assistant/home-assistant
Commit Name: d5813cf167dc4899e241c823d71243375c5d40c4
Time: 2018-09-21
Author: exxamalte@users.noreply.github.com
File Name: tests/components/binary_sensor/test_rest.py
Class Name: TestRestBinarySensorSetup
Method Name: test_setup_failed_connect


Project Name: home-assistant/home-assistant
Commit Name: d5813cf167dc4899e241c823d71243375c5d40c4
Time: 2018-09-21
Author: exxamalte@users.noreply.github.com
File Name: tests/components/sensor/test_rest.py
Class Name: TestRestSensorSetup
Method Name: test_setup_timeout


Project Name: home-assistant/home-assistant
Commit Name: d5813cf167dc4899e241c823d71243375c5d40c4
Time: 2018-09-21
Author: exxamalte@users.noreply.github.com
File Name: tests/components/binary_sensor/test_rest.py
Class Name: TestRestBinarySensorSetup
Method Name: test_setup_timeout