ff9688bb7a135d7d50208908d930f1be61add773,tests/components/switch/test_vultr.py,TestVultrSwitchSetup,test_turn_off,#TestVultrSwitchSetup#Any#,146

Before Change


    @requests_mock.Mocker()
    def test_turn_off(self, mock):
        Test turning a subscription off.
        mock.get(
            "https://api.vultr.com/v1/server/list?api_key=ABCDEFG1234567",
            text=load_fixture("vultr_server_list.json"))

        mock.post(
            "https://api.vultr.com/v1/server/halt?api_key=ABCDEFG1234567")

After Change


    @requests_mock.Mocker()
    def test_turn_off(self, mock):
        Test turning a subscription off.
        with patch(
            "vultr.Vultr.server_list",
            return_value=json.loads(load_fixture("vultr_server_list.json"))), \
                patch("vultr.Vultr.server_halt") as mock_halt:
            for device in self.DEVICES:
                if device.name == "A Server":
                    device.turn_off()

        // Turn off
        self.assertEqual(1, mock_halt.call_count)

    def test_invalid_switch_config(self):
        Test config type failures.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 8

Non-data size: 5

Instances


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/switch/test_vultr.py
Class Name: TestVultrSwitchSetup
Method Name: test_turn_off


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/sensor/test_vultr.py
Class Name: TestVultrSensorSetup
Method Name: test_invalid_sensors


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/sensor/test_vultr.py
Class Name: TestVultrSensorSetup
Method Name: test_sensor


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/binary_sensor/test_vultr.py
Class Name: TestVultrBinarySensorSetup
Method Name: test_invalid_sensors


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/switch/test_vultr.py
Class Name: TestVultrSwitchSetup
Method Name: test_invalid_switches


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/binary_sensor/test_vultr.py
Class Name: TestVultrBinarySensorSetup
Method Name: test_binary_sensor


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/switch/test_vultr.py
Class Name: TestVultrSwitchSetup
Method Name: test_turn_on


Project Name: home-assistant/home-assistant
Commit Name: ff9688bb7a135d7d50208908d930f1be61add773
Time: 2018-01-05
Author: paulus@paulusschoutsen.nl
File Name: tests/components/switch/test_vultr.py
Class Name: TestVultrSwitchSetup
Method Name: test_switch