Ejemplo n.º 1
0
 def test_list(self, mock_name_matches_object,
               mock_resource_manager__manager):
     server_groups = [mock.MagicMock(name="rally_foo1"),
                      mock.MagicMock(name="rally_foo2"),
                      mock.MagicMock(name="foo3")]
     mock_name_matches_object.side_effect = [False, True, True]
     mock_resource_manager__manager().list.return_value = server_groups
     self.assertEqual(server_groups, resources.NovaServerGroups().list())
Ejemplo n.º 2
0
 def test_list(self, mock_name_matches_object,
               mock_resource_manager__manager):
     server_groups = [
         mock.MagicMock(name="rally_foo1"),
         mock.MagicMock(name="rally_foo2"),
         mock.MagicMock(name="foo3")
     ]
     mock_name_matches_object.side_effect = [False, True, True]
     mock_resource_manager__manager().list.return_value = server_groups
     self.assertEqual(server_groups[1:],
                      resources.NovaServerGroups().list())
     mock_name_matches_object.assert_has_calls(
         [mock.call(r.name, nutils.NovaScenario) for r in server_groups])