def test_power_on_calls_power_control_nova(self): system_id, machine, tenant, username, password, authurl, context = ( self.make_parameters()) nova_power_driver = NovaPowerDriver() power_control_nova_mock = self.patch( nova_power_driver, 'power_control_nova') nova_power_driver.power_on(system_id, context) self.assertThat( power_control_nova_mock, MockCalledOnceWith('on', **context))
'os_password': password, 'os_authurl': authurl, 'user_domain_name': user_domain_name, 'project_domain_name': project_domain_name, } return system_id, machine, tenant, username, password, authurl, user_domain_name, project_domain_name, context def test_power_on_calls_power_control_nova_v3(self): system_id, machine, tenant, username, password, authurl, user_domain_name, project_domain_name, context = ( self.make_parameters_v3()) nova_power_driver = NovaPowerDriver() power_control_nova_mock = self.patch( nova_power_driver, 'power_control_nova') nova_power_driver.power_on(system_id, context) self.assertThat( power_control_nova_mock, MockCalledOnceWith('on', **context)) def test_power_off_calls_power_control_nova_v3(self): system_id, machine, tenant, username, password, authurl, user_domain_name, project_domain_name, context = ( self.make_parameters_v3()) nova_power_driver = NovaPowerDriver() power_control_nova_mock = self.patch( nova_power_driver, 'power_control_nova') nova_power_driver.power_off(system_id, context) self.assertThat( power_control_nova_mock, MockCalledOnceWith('off', **context))