Пример #1
0
    def test_global_initialize(self, mock_mapping):
        mock_mapping.return_value = [['aaa', mock.Mock()]]

        environment._environment = None
        environment.initialize()

        expected = [mock.call('senlin.profiles'),
                    mock.call('senlin.policies'),
                    mock.call('senlin.triggers'),
                    mock.call('senlin.drivers')]

        self.assertIsNotNone(environment._environment)
        self.assertEqual(expected, mock_mapping.call_args_list)
        self.assertIsNotNone(environment.global_env().get_profile('aaa'))
        self.assertIsNotNone(environment.global_env().get_policy('aaa'))
        self.assertIsNotNone(environment.global_env().get_trigger('aaa'))
        self.assertIsNotNone(environment.global_env().get_driver('aaa'))

        environment._environment = None
Пример #2
0
    def test_global_initialize(self, mock_mapping):
        mock_mapping.return_value = [["aaa", mock.Mock()]]

        environment._environment = None
        environment.initialize()

        expected = [
            mock.call("senlin.profiles"),
            mock.call("senlin.policies"),
            mock.call("senlin.triggers"),
            mock.call("senlin.drivers"),
        ]

        self.assertIsNotNone(environment._environment)
        self.assertEqual(expected, mock_mapping.call_args_list)
        self.assertIsNotNone(environment.global_env().get_profile("aaa"))
        self.assertIsNotNone(environment.global_env().get_policy("aaa"))
        self.assertIsNotNone(environment.global_env().get_trigger("aaa"))
        self.assertIsNotNone(environment.global_env().get_driver("aaa"))

        environment._environment = None