Ejemplo n.º 1
0
 def test_get_machine(self, mock_client):
     node = fakes.FakeMachine(id='00000000-0000-0000-0000-000000000000',
                              name='bigOlFaker')
     mock_client.node.get.return_value = node
     machine = self.op_cloud.get_machine('bigOlFaker')
     mock_client.node.get.assert_called_with(node_id='bigOlFaker')
     self.assertEqual(meta.obj_to_dict(node), machine)
Ejemplo n.º 2
0
 def test_list_machines(self, mock_client):
     m1 = fakes.FakeMachine(1, 'fake_machine1')
     mock_client.node.list.return_value = [m1]
     machines = self.op_cloud.list_machines()
     self.assertTrue(mock_client.node.list.called)
     self.assertEqual(meta.obj_to_dict(m1), machines[0])