Esempio n. 1
0
 def test_list(self):
     magnum = resources.MagnumMixin()
     magnum._service = "magnum"
     some_resources = [mock.MagicMock(), mock.MagicMock(),
                       mock.MagicMock(), mock.MagicMock()]
     magnum._manager = mock.MagicMock()
     magnum._manager.return_value.list.side_effect = (
         some_resources[:2], some_resources[2:4], [])
     self.assertEqual(some_resources, magnum.list())
     self.assertEqual(
         [mock.call(marker=None), mock.call(marker=some_resources[1].uuid),
          mock.call(marker=some_resources[3].uuid)],
         magnum._manager.return_value.list.call_args_list)
Esempio n. 2
0
 def test_id(self):
     magnum = resources.MagnumMixin()
     magnum._service = "magnum"
     magnum.raw_resource = mock.MagicMock()
     self.assertEqual(magnum.raw_resource.uuid, magnum.id())