Beispiel #1
0
    def test_cleanup(self, mock_cleanup, mock_create_env):
        murano_ctx = murano_environments.EnvironmentGenerator(
            self._get_context())
        murano_ctx.setup()
        murano_ctx.cleanup()

        mock_cleanup.assert_called_once_with(names=["murano.environments"],
                                             users=murano_ctx.context["users"])
    def test_setup(self, mock_create_env):
        murano_ctx = murano_environments.EnvironmentGenerator(
            self._get_context())
        murano_ctx.setup()

        self.assertEqual(2, len(murano_ctx.context["tenants"]))
        tenant_id = murano_ctx.context["users"][0]["tenant_id"]
        self.assertEqual(
            [mock_create_env.return_value],
            murano_ctx.context["tenants"][tenant_id]["environments"])
    def test_cleanup(self, mock_cleanup, mock_create_env):
        murano_ctx = murano_environments.EnvironmentGenerator(
            self._get_context())
        murano_ctx.setup()
        murano_ctx.cleanup()

        mock_cleanup.assert_called_once_with(
            names=["murano.environments"],
            users=murano_ctx.context["users"],
            superclass=murano_utils.MuranoScenario,
            task_id="foo_uuid")
Beispiel #4
0
    def test_cleanup(self, mock_cleanup,
                     mock_murano_scenario__create_environment):
        mock_env = mock.Mock()
        mock_murano_scenario__create_environment.return_value = mock_env

        murano_ctx = murano_environments.EnvironmentGenerator(
            self._get_context())
        murano_ctx.setup()
        murano_ctx.cleanup()

        mock_cleanup.assert_called_once_with(names=["murano.environments"],
                                             users=murano_ctx.context["users"])
Beispiel #5
0
    def test_setup(self, mock_murano_scenario__create_environment):
        mock_env = mock.MagicMock()
        mock_murano_scenario__create_environment.return_value = mock_env

        murano_ctx = murano_environments.EnvironmentGenerator(
            self._get_context())
        murano_ctx.setup()

        self.assertEqual(2, len(murano_ctx.context["tenants"]))
        tenant_id = murano_ctx.context["users"][0]["tenant_id"]
        self.assertEqual(
            [mock_env],
            murano_ctx.context["tenants"][tenant_id]["environments"])