Skip to content

Commit ab3f882

Browse files
committed
Add mention of testing library
1 parent 5575654 commit ab3f882

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,36 @@ This project uses [*towncrier*](https://towncrier.readthedocs.io/) and the chang
1313

1414
## [1.3.0](https://github.com/opsmill/infrahub-sdk-python/tree/v1.3.0) - 2024-12-30
1515

16+
### Added
17+
18+
#### Testing library (**Alpha**)
19+
20+
A new collection of tools and utilities to help with testing is available under `infrahub_sdk.testing`.
21+
22+
The first component available is a `TestInfrahubDockerClient`, a pytest Class designed to help creating integration tests based on Infrahub. See a simple example below to help you get started.
23+
24+
> the installation of `infrahub-testcontainers` is required
25+
26+
```python
27+
import pytest
28+
29+
from infrahub_sdk import InfrahubClient
30+
from infrahub_sdk.testing.docker import TestInfrahubDockerClient
31+
32+
class TestInfrahubNode(TestInfrahubDockerClient):
33+
34+
@pytest.fixture(scope="class")
35+
def infrahub_version(self) -> str:
36+
"""Required (for now) to define the version of infrahub to use."""
37+
return "1.0.10"
38+
39+
@pytest.fixture(scope="class")
40+
async def test_create_tag(self, default_branch: str, client: InfrahubClient) -> None:
41+
obj = await client.create(kind="BuiltinTag", name="Blue")
42+
await obj.save()
43+
assert obj.id
44+
```
45+
1646
### Changed
1747

1848
- The Pydantic models for the schema have been split into multiple versions to align better with the different phase of the lifecycle of the schema.

0 commit comments

Comments
 (0)