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'))
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"))