def test_to_string(self): server = mock.MagicMock() self.assertIn("VM (", nova.Servers(self.creds_manager).to_str(server))
def test_list(self): self.assertIs(self.cloud.list_servers.return_value, nova.Servers(self.creds_manager).list()) self.cloud.list_servers.assert_called_once_with()
def test_delete(self): server = mock.MagicMock() self.assertIsNone(nova.Servers(self.creds_manager).delete(server)) self.cloud.delete_server.assert_called_once_with(server['id'])
def test_disable(self): server = mock.MagicMock() self.assertIsNone(nova.Servers(self.creds_manager).disable(server)) self.cloud.compute.stop_server.assert_called_once_with(server['id'])