pulumi-extra 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.devcontainer/devcontainer.json +2 -5
  2. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.devcontainer/postAttachCommand.sh +2 -0
  3. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.github/dependabot.yaml +2 -1
  4. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.github/workflows/ci.yaml +11 -2
  5. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.github/workflows/release.yaml +1 -1
  6. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/Makefile +1 -1
  7. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/PKG-INFO +8 -4
  8. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/README.md +1 -1
  9. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/autotag.py +1 -1
  10. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/autolabel.py +1 -1
  11. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pyproject.toml +12 -3
  12. pulumi_extra-0.1.2/tests/_helpers.py +7 -0
  13. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/test_resource_.py +5 -6
  14. pulumi_extra-0.1.2/tests/transforms/test_invoke.py +69 -0
  15. pulumi_extra-0.1.2/tests/transforms/test_resource_.py +71 -0
  16. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/uv.lock +473 -426
  17. pulumi_extra-0.1.0/tests/_helpers.py +0 -5
  18. pulumi_extra-0.1.0/tests/transforms/test_invoke.py +0 -0
  19. pulumi_extra-0.1.0/tests/transforms/test_resource_.py +0 -0
  20. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.devcontainer/Dockerfile +0 -0
  21. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.devcontainer/docker-compose.devcontainer.yaml +0 -0
  22. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.devcontainer/onCreateCommand.sh +0 -0
  23. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.editorconfig +0 -0
  24. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.gitattributes +0 -0
  25. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.gitignore +0 -0
  26. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.pre-commit-config.yaml +0 -0
  27. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.python-version +0 -0
  28. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.vscode/extensions.json +0 -0
  29. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/.vscode/settings.json +0 -0
  30. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/LICENSE +0 -0
  31. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/noxfile.py +0 -0
  32. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/__init__.py +0 -0
  33. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/__init__.py +0 -0
  34. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/__init__.py +0 -0
  35. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/common.py +0 -0
  36. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/policies/__init__.py +0 -0
  37. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/policies/require_description.py +0 -0
  38. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/aws/policies/require_tags.py +0 -0
  39. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/__init__.py +0 -0
  40. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/common.py +0 -0
  41. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/policies/__init__.py +0 -0
  42. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/policies/require_description.py +0 -0
  43. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/contrib/gcp/policies/require_labels.py +0 -0
  44. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/errors.py +0 -0
  45. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/output.py +0 -0
  46. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/py.typed +0 -0
  47. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/resource_.py +0 -0
  48. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/stack_reference.py +0 -0
  49. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/transforms/__init__.py +0 -0
  50. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/transforms/invoke.py +0 -0
  51. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/transforms/resource_.py +0 -0
  52. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/pulumi_extra/transforms/runtime.py +0 -0
  53. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/__init__.py +0 -0
  54. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/conftest.py +0 -0
  55. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/__init__.py +0 -0
  56. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/__init__.py +0 -0
  57. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/policies/__init__.py +0 -0
  58. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/policies/test_require_description.py +0 -0
  59. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/policies/test_require_tags.py +0 -0
  60. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/test_autotag.py +0 -0
  61. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/aws/test_common.py +0 -0
  62. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/__init__.py +0 -0
  63. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/policies/__init__.py +0 -0
  64. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/policies/test_require_description.py +0 -0
  65. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/policies/test_require_labels.py +0 -0
  66. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/test_autolabel.py +0 -0
  67. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/contrib/gcp/test_common.py +0 -0
  68. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/test_output.py +0 -0
  69. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/test_stack_reference.py +0 -0
  70. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/transforms/__init__.py +0 -0
  71. {pulumi_extra-0.1.0 → pulumi_extra-0.1.2}/tests/transforms/test_runtime.py +0 -0
@@ -10,11 +10,11 @@
10
10
  "overrideCommand": true,
11
11
  "workspaceFolder": "/workspaces/pulumi-extra",
12
12
  "features": {
13
- "ghcr.io/devcontainers-contrib/features/pre-commit:2": {},
13
+ "ghcr.io/devcontainers-extra/features/pre-commit:2": {},
14
14
  "ghcr.io/devcontainers/features/docker-in-docker:2": {}
15
15
  },
16
16
  "onCreateCommand": "./.devcontainer/onCreateCommand.sh",
17
- "postAttachCommand": "make install",
17
+ "postAttachCommand": "./.devcontainer/postAttachCommand.sh",
18
18
  "customizations": {
19
19
  "vscode": {
20
20
  "extensions": [
@@ -33,8 +33,5 @@
33
33
  "ms-python.debugpy"
34
34
  ]
35
35
  }
36
- },
37
- "containerEnv": {
38
- "PYTHONPATH": "${containerWorkspaceFolder}"
39
36
  }
40
37
  }
@@ -1,3 +1,5 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  sudo chown --recursive "$(id --user):$(id --group)" ~
4
+
5
+ make install
@@ -1,12 +1,13 @@
1
1
  # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2
2
  version: 2
3
+ enable-beta-ecosystems: true
3
4
  updates:
4
5
  - package-ecosystem: github-actions
5
6
  directory: /
6
7
  schedule:
7
8
  interval: monthly
8
9
 
9
- - package-ecosystem: pip
10
+ - package-ecosystem: uv
10
11
  directory: /
11
12
  schedule:
12
13
  interval: monthly
@@ -20,7 +20,7 @@ jobs:
20
20
  uses: actions/checkout@v4
21
21
 
22
22
  - name: Set up uv
23
- uses: astral-sh/setup-uv@v5
23
+ uses: astral-sh/setup-uv@v6
24
24
  with:
25
25
  version: latest
26
26
  enable-cache: true
@@ -28,6 +28,15 @@ jobs:
28
28
  - name: Install deps
29
29
  run: uv sync --all-extras
30
30
 
31
+ - name: Toolchain caching
32
+ uses: actions/cache@v4
33
+ with:
34
+ path: |
35
+ .mypy_cache
36
+ key: ${{ runner.os }}-toolchain-cache-${{ hashFiles('**/uv.lock') }}
37
+ restore-keys: |
38
+ ${{ runner.os }}-toolchain-cache-
39
+
31
40
  - uses: pre-commit/action@v3.0.1
32
41
  env:
33
42
  SKIP: pytest
@@ -51,7 +60,7 @@ jobs:
51
60
  uses: actions/checkout@v4
52
61
 
53
62
  - name: Set up uv
54
- uses: astral-sh/setup-uv@v5
63
+ uses: astral-sh/setup-uv@v6
55
64
  with:
56
65
  version: latest
57
66
  enable-cache: true
@@ -17,7 +17,7 @@ jobs:
17
17
  uses: actions/checkout@v4
18
18
 
19
19
  - name: Set up uv
20
- uses: astral-sh/setup-uv@v5
20
+ uses: astral-sh/setup-uv@v6
21
21
  with:
22
22
  version: latest
23
23
  enable-cache: true
@@ -46,7 +46,7 @@ lint: ## Run all linters
46
46
  .PHONY: lint
47
47
 
48
48
  test: ## Run tests
49
- uv run pytest
49
+ uv run nox
50
50
  uv run coverage html
51
51
  .PHONY: test
52
52
 
@@ -1,7 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pulumi-extra
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Extra Pulumi utils and resources.
5
+ Project-URL: Homepage, https://github.com/lasuillard/pulumi-extra
6
+ Project-URL: Repository, https://github.com/lasuillard/pulumi-extra.git
7
+ Project-URL: Issues, https://github.com/lasuillard/pulumi-extra/issues
5
8
  Author-email: Yuchan Lee <lasuillard@gmail.com>
6
9
  License-Expression: MIT
7
10
  License-File: LICENSE
@@ -20,10 +23,11 @@ Provides-Extra: policy
20
23
  Requires-Dist: pulumi-policy<2,>=1; extra == 'policy'
21
24
  Provides-Extra: test
22
25
  Requires-Dist: coverage~=7.3; extra == 'test'
23
- Requires-Dist: nox~=2024.10.9; extra == 'test'
26
+ Requires-Dist: nox<2025.3.0,>=2024.10.9; extra == 'test'
27
+ Requires-Dist: pulumi-docker>=4.6.1; extra == 'test'
24
28
  Requires-Dist: pulumi-random>=4.18.0; extra == 'test'
25
29
  Requires-Dist: pytest-cov<7,>=5; extra == 'test'
26
- Requires-Dist: pytest-order>=1.3.0; extra == 'test'
30
+ Requires-Dist: pytest-forked>=1.6.0; extra == 'test'
27
31
  Requires-Dist: pytest-sugar~=1.0; extra == 'test'
28
32
  Requires-Dist: pytest~=8.0; extra == 'test'
29
33
  Description-Content-Type: text/markdown
@@ -33,6 +37,6 @@ Description-Content-Type: text/markdown
33
37
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
34
38
  [![CI](https://github.com/lasuillard/pulumi-extra/actions/workflows/ci.yaml/badge.svg)](https://github.com/lasuillard/pulumi-extra/actions/workflows/ci.yaml)
35
39
  [![codecov](https://codecov.io/gh/lasuillard/pulumi-extra/graph/badge.svg?token=uuckU93NAu)](https://codecov.io/gh/lasuillard/pulumi-extra)
36
- ![GitHub Release](https://img.shields.io/github/v/release/lasuillard/pulumi-extra)
40
+ [![PyPI - Version](https://img.shields.io/pypi/v/pulumi-extra)](https://pypi.org/project/pulumi-extra/)
37
41
 
38
42
  Extra Pulumi utils and resources.
@@ -3,6 +3,6 @@
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![CI](https://github.com/lasuillard/pulumi-extra/actions/workflows/ci.yaml/badge.svg)](https://github.com/lasuillard/pulumi-extra/actions/workflows/ci.yaml)
5
5
  [![codecov](https://codecov.io/gh/lasuillard/pulumi-extra/graph/badge.svg?token=uuckU93NAu)](https://codecov.io/gh/lasuillard/pulumi-extra)
6
- ![GitHub Release](https://img.shields.io/github/v/release/lasuillard/pulumi-extra)
6
+ [![PyPI - Version](https://img.shields.io/pypi/v/pulumi-extra)](https://pypi.org/project/pulumi-extra/)
7
7
 
8
8
  Extra Pulumi utils and resources.
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  import pulumi
7
- import pulumi_aws # noqa: F401; Required to detect resources otherwise `is_taggable` will always return `False`
7
+ import pulumi_aws # noqa: F401 ; Required to detect resources otherwise `is_taggable` will always return `False`
8
8
 
9
9
  from pulumi_extra import resource_has_attribute
10
10
 
@@ -4,7 +4,7 @@ from __future__ import annotations
4
4
  from typing import TYPE_CHECKING
5
5
 
6
6
  import pulumi
7
- import pulumi_gcp # noqa: F401; Required to detect resources otherwise `is_labelable` will always return `False`
7
+ import pulumi_gcp # noqa: F401 ; Required to detect resources otherwise `is_labelable` will always return `False`
8
8
 
9
9
  from pulumi_extra import resource_has_attribute
10
10
 
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "pulumi-extra"
3
3
  description = "Extra Pulumi utils and resources."
4
- version = "0.1.0"
4
+ version = "0.1.2"
5
5
  authors = [{ name = "Yuchan Lee", email = "lasuillard@gmail.com" }]
6
6
  readme = "README.md"
7
7
  license = "MIT"
@@ -15,14 +15,20 @@ test = [
15
15
  "pytest-cov>=5,<7",
16
16
  "pytest-sugar~=1.0",
17
17
  "pytest~=8.0",
18
- "nox~=2024.10.9",
18
+ "nox>=2024.10.9,<2025.3.0",
19
19
  "pulumi-random>=4.18.0",
20
- "pytest-order>=1.3.0",
20
+ "pulumi-docker>=4.6.1",
21
+ "pytest-forked>=1.6.0",
21
22
  ]
22
23
  policy = ["pulumi-policy>=1,<2"]
23
24
  aws = ["pulumi-aws>=6"]
24
25
  gcp = ["pulumi-gcp>=8"]
25
26
 
27
+ [project.urls]
28
+ Homepage = "https://github.com/lasuillard/pulumi-extra"
29
+ Repository = "https://github.com/lasuillard/pulumi-extra.git"
30
+ Issues = "https://github.com/lasuillard/pulumi-extra/issues"
31
+
26
32
  [build-system]
27
33
  requires = ["hatchling"]
28
34
  build-backend = "hatchling.build"
@@ -71,6 +77,9 @@ addopts = [
71
77
  "-rs",
72
78
  ]
73
79
  testpaths = ["tests"]
80
+ markers = [
81
+ "integration: mark a test as an integration test",
82
+ ]
74
83
 
75
84
  [tool.coverage.run]
76
85
  include = ["pulumi_extra/*"]
@@ -0,0 +1,7 @@
1
+ from typing import Any
2
+
3
+ from pulumi import automation
4
+
5
+
6
+ def resolve_output_values(outputs: automation.OutputMap) -> dict[str, Any]:
7
+ return {k: v.value for k, v in outputs.items()}
@@ -4,14 +4,13 @@ import pytest
4
4
 
5
5
  from pulumi_extra import get_resource_cls, resource_has_attribute
6
6
  from pulumi_extra.errors import UnknownResourceTypeError
7
- from tests._helpers import Order
8
7
 
9
8
 
10
9
  class Test__resource_has_attribute:
11
- @pytest.mark.order(Order.AfterRegistryInit)
10
+ @pytest.mark.forked
12
11
  def test(self) -> None:
13
12
  # Arrange
14
- import pulumi_random # noqa: F401
13
+ import pulumi_random # noqa: F401, PLC0415
15
14
 
16
15
  # Act & Assert
17
16
  assert resource_has_attribute("random:index/randomId:RandomId", "byte_length") is True
@@ -31,10 +30,10 @@ class Test__resource_has_attribute:
31
30
 
32
31
 
33
32
  class Test__get_resource_cls:
34
- @pytest.mark.order(Order.AfterRegistryInit)
33
+ @pytest.mark.forked
35
34
  def test(self) -> None:
36
35
  # Arrange
37
- import pulumi_random # noqa: F401
36
+ import pulumi_random # noqa: F401, PLC0415
38
37
 
39
38
  # Act
40
39
  cls = get_resource_cls("random:index/randomId:RandomId")
@@ -43,7 +42,7 @@ class Test__get_resource_cls:
43
42
  assert cls is not None
44
43
  assert f"{cls.__module__}.{cls.__name__}" == "pulumi_random.random_id.RandomId"
45
44
 
46
- @pytest.mark.order(Order.BeforeRegistryInit)
45
+ @pytest.mark.forked
47
46
  def test_registry_not_initialized(self) -> None:
48
47
  """If registry not initialized, it will return `None`."""
49
48
  # Arrange
@@ -0,0 +1,69 @@
1
+ from collections.abc import Iterator
2
+ from pathlib import Path
3
+
4
+ import pulumi
5
+ import pytest
6
+ from pulumi import automation
7
+
8
+ from pulumi_extra import override_invoke, override_invoke_defaults
9
+ from tests._helpers import resolve_output_values
10
+
11
+ pytestmark = pytest.mark.integration
12
+
13
+
14
+ def pulumi_program() -> None:
15
+ import pulumi_docker as docker # noqa: PLC0415
16
+
17
+ # ? Invoke transforms cannot be applied to per-resource basis
18
+ invoke_transforms = [
19
+ # Will modify default
20
+ override_invoke_defaults("*", defaults={"insecure_skip_verify": True}),
21
+ # This will not have any effect (no match)
22
+ override_invoke("_", args={"insecure_skip_verify": False}),
23
+ # Will override argument
24
+ override_invoke("*", args={"name": "busybox"}),
25
+ ]
26
+ for it in invoke_transforms:
27
+ pulumi.runtime.register_invoke_transform(it)
28
+
29
+ busybox = docker.get_registry_image(name="scratch")
30
+
31
+ for attr in ("name", "insecure_skip_verify"):
32
+ pulumi.export(attr, getattr(busybox, attr))
33
+
34
+
35
+ @pytest.fixture
36
+ def pulumi_stack(tmpdir: Path) -> Iterator[automation.Stack]:
37
+ stack = automation.create_or_select_stack(
38
+ stack_name="test",
39
+ project_name="test",
40
+ program=pulumi_program,
41
+ opts=automation.LocalWorkspaceOptions(
42
+ env_vars={
43
+ "PULUMI_BACKEND_URL": f"file://{tmpdir}",
44
+ "PULUMI_CONFIG_PASSPHRASE": "test",
45
+ },
46
+ ),
47
+ )
48
+ stack.up(on_output=print)
49
+ yield stack
50
+ stack.destroy(on_output=print, remove=True)
51
+
52
+
53
+ class Test__override_invoke:
54
+ @pytest.mark.forked
55
+ def test(self, pulumi_stack: automation.Stack) -> None:
56
+ # Arrange
57
+ # ...
58
+
59
+ # Act
60
+ outputs = pulumi_stack.outputs()
61
+
62
+ # Assert
63
+ assert resolve_output_values(outputs) == {
64
+ "name": "busybox",
65
+ "insecure_skip_verify": True,
66
+ }
67
+
68
+
69
+ # TODO(lasuillard): `override_invoke_options` has not been tested, currently I'm not aware of a way (inspect resource's options) to test it. # noqa: E501
@@ -0,0 +1,71 @@
1
+ from collections.abc import Iterator
2
+ from pathlib import Path
3
+
4
+ import pulumi
5
+ import pytest
6
+ from pulumi import automation
7
+
8
+ from pulumi_extra import override_resource, override_resource_defaults
9
+ from tests._helpers import resolve_output_values
10
+
11
+ pytestmark = pytest.mark.integration
12
+
13
+
14
+ def pulumi_program() -> None:
15
+ import pulumi_docker as docker # noqa: PLC0415
16
+
17
+ busybox = docker.RemoteImage(
18
+ "busybox",
19
+ opts=pulumi.ResourceOptions(
20
+ transforms=[
21
+ # Modify default
22
+ override_resource_defaults("*", defaults={"platform": "linux/amd64"}),
23
+ # This will not have any effect (no match)
24
+ override_resource("_", props={"platform": "linux/arm64"}),
25
+ # Will modify argument
26
+ override_resource("*", props={"name": "busybox"}),
27
+ ],
28
+ ),
29
+ name="scratch",
30
+ keep_locally=True,
31
+ )
32
+
33
+ for attr in ("name", "platform"):
34
+ pulumi.export(attr, getattr(busybox, attr))
35
+
36
+
37
+ @pytest.fixture
38
+ def pulumi_stack(tmpdir: Path) -> Iterator[automation.Stack]:
39
+ stack = automation.create_or_select_stack(
40
+ stack_name="test",
41
+ project_name="test",
42
+ program=pulumi_program,
43
+ opts=automation.LocalWorkspaceOptions(
44
+ env_vars={
45
+ "PULUMI_BACKEND_URL": f"file://{tmpdir}",
46
+ "PULUMI_CONFIG_PASSPHRASE": "test",
47
+ },
48
+ ),
49
+ )
50
+ stack.up(on_output=print)
51
+ yield stack
52
+ stack.destroy(on_output=print, remove=True)
53
+
54
+
55
+ class Test__override_resource:
56
+ @pytest.mark.forked
57
+ def test(self, pulumi_stack: automation.Stack) -> None:
58
+ # Arrange
59
+ # ...
60
+
61
+ # Act
62
+ outputs = pulumi_stack.outputs()
63
+
64
+ # Assert
65
+ assert resolve_output_values(outputs) == {
66
+ "name": "busybox",
67
+ "platform": "linux/amd64", # Original default value is ""
68
+ }
69
+
70
+
71
+ # TODO(lasuillard): `override_resource_options` has not been tested, currently I'm not aware of a way (inspect resource's options) to test it. # noqa: E501