예제 #1
0
파일: test_amt.py 프로젝트: zeronewb/maas
    def test_power_query_queries_with_wsman(self):
        amt_power_driver = AMTPowerDriver()
        context = make_context()
        _get_amt_command_mock = self.patch(
            amt_power_driver, '_get_amt_command')
        _get_amt_command_mock.return_value = 'wsman'
        wsman_query_state_mock = self.patch(
            amt_power_driver, 'wsman_query_state')
        wsman_query_state_mock.return_value = 'on'

        state = amt_power_driver.power_query(context['system_id'], context)

        self.expectThat(
            _get_amt_command_mock, MockCalledOnceWith(
                context['ip_address'], context['power_pass']))
        self.expectThat(
            wsman_query_state_mock, MockCalledOnceWith(
                context['ip_address'], context['power_pass']))
        self.expectThat(state, Equals('on'))
예제 #2
0
    def test_power_query_queries_with_wsman(self):
        amt_power_driver = AMTPowerDriver()
        context = make_context()
        _get_amt_command_mock = self.patch(amt_power_driver,
                                           "_get_amt_command")
        _get_amt_command_mock.return_value = "wsman"
        wsman_query_state_mock = self.patch(amt_power_driver,
                                            "wsman_query_state")
        wsman_query_state_mock.return_value = "on"

        state = amt_power_driver.power_query(context["system_id"], context)

        self.expectThat(
            _get_amt_command_mock,
            MockCalledOnceWith(context["ip_address"], context["power_pass"]),
        )
        self.expectThat(
            wsman_query_state_mock,
            MockCalledOnceWith(context["ip_address"], context["power_pass"]),
        )
        self.expectThat(state, Equals("on"))