Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-neustroev committed Jan 2, 2025
1 parent d2d6f2b commit 52fc4a8
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 44 deletions.
4 changes: 1 addition & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@
"python": "${workspaceFolder}/.venv/bin/python",
"request": "launch",
"type": "debugpy",
"args": [
"new"
]
"args": ["new"]
}
]
}
4 changes: 3 additions & 1 deletion integrations/hibob/hibob/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ def __init__(self, api_url: str, username: str, password: str):
self.api_url = api_url
self.username = username
self.password = password
logger.info(f"Initializing Hibob client with API {api_url} and API service username {username}")
logger.info(
f"Initializing Hibob client with API {api_url} and API service username {username}"
)
self.client = http_async_client
self.client.auth = BasicAuth(username, password)
self.client.timeout = Timeout(30)
Expand Down
80 changes: 43 additions & 37 deletions integrations/hibob/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion integrations/hibob/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ authors = ["Arseny Neustroev <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.12"
port_ocean = { version = "^0.16.0", extras = ["cli"] }
port_ocean = {version = "^0.17.2", extras = ["cli"]}
httpx = "^0.27.0"
loguru = "^0.7.3"
pytest = "^8.3.4"
pytest-httpx = ">=0.30.0"

[tool.poetry.group.dev.dependencies]
# Uncomment this if you want to debug the ocean core together with your integration
Expand Down
16 changes: 16 additions & 0 deletions integrations/hibob/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from typing import Any

from port_ocean.tests.helpers.fixtures import (
get_mocked_ocean_app,
get_mock_ocean_resource_configs,
)
import pytest


def pytest_collection_modifyitems(session: Any, config: Any, items: Any) -> None:
for item in items:
# This allows us to re-requestd the same mocked endpoint several times
item.add_marker(pytest.mark.httpx_mock(can_send_already_matched_responses=True))


# ruff: noqa
2 changes: 0 additions & 2 deletions integrations/hibob/tests/test_sample.py

This file was deleted.

Loading

0 comments on commit 52fc4a8

Please sign in to comment.