Exemplo n.º 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"])
Exemplo n.º 2
0
    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"])
Exemplo n.º 3
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"],
            superclass=murano_utils.MuranoScenario,
            task_id="foo_uuid")
Exemplo n.º 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"])
Exemplo n.º 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"])