Skip to content

Commit 1043442

Browse files
committed
Add integration test
1 parent d93057a commit 1043442

File tree

14 files changed

+42
-3
lines changed

14 files changed

+42
-3
lines changed

.github/workflows/pull_request.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ jobs:
4141
run: uv run --frozen -- pytest -m unit
4242
shell: bash
4343

44-
# - name: Integration tests
45-
# run: uv run --frozen -- pytest -m integration
46-
# shell: bash
44+
- name: Integration tests
45+
run: uv run --frozen -- pytest -m integration
46+
shell: bash
4747

4848
deploy-api-dev:
4949
needs: continuous-integration

api/tests/__init__.py

Whitespace-only changes.

api/tests/integration/__init__.py

Whitespace-only changes.

api/tests/integration/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pytest
2+
3+
from api.dependency_container import DependencyContainer
4+
5+
6+
@pytest.fixture(autouse=True)
7+
def initialize_dependency_container() -> None:
8+
DependencyContainer.initialize()

api/tests/integration/workflows/__init__.py

Whitespace-only changes.

api/tests/integration/workflows/products/__init__.py

Whitespace-only changes.

api/tests/integration/workflows/products/publish_product/__init__.py

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import pytest
2+
3+
from api.dependency_container import DependencyContainer
4+
from test_utils.builders.api.workflows.products.publish_product.publish_product_request_builder import (
5+
PublishProductRequestBuilder,
6+
)
7+
8+
9+
@pytest.mark.integration
10+
class TestPublishProductWorkflow:
11+
async def test_publish_product(self) -> None:
12+
request = PublishProductRequestBuilder().build()
13+
14+
workflow = DependencyContainer.get_publish_product_workflow()
15+
16+
await workflow.execute(request)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ignore = [
6161

6262

6363
[tool.pytest.ini_options]
64+
addopts = ["--import-mode=importlib"]
6465
asyncio_mode = "auto"
6566
asyncio_default_fixture_loop_scope = "function"
6667
markers = ["unit: Unit tests", "integration: Integration tests"]

test_utils/src/test_utils/builders/api/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)