Skip to content

Commit 8622c54

Browse files
authored
Merge pull request #1 from scnsh/feature/ci
Add gha for test and lint
2 parents bef15a4 + e2a1dc2 commit 8622c54

File tree

4 files changed

+65
-6
lines changed

4 files changed

+65
-6
lines changed

.github/workflows/python-ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.13"
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v5
23+
with:
24+
version: "0.7.3"
25+
enable-cache: true
26+
27+
- name: Install dependencies
28+
run: uv sync --frozen --all-extras --dev
29+
30+
- name: Run pytest
31+
# Skip real API validation tests
32+
run: uv run pytest -v -m "not integration"
33+
34+
- name: Run ruff format check
35+
run: uv run ruff format --check .

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dev-dependencies = [
3434
"pytest",
3535
"ruff",
3636
"python-dotenv",
37+
"uv>=0.7.3",
3738
]
3839

3940
[tool.pytest.ini_options]

tests/test_main_tools.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ def test_posts_update_success(mock_esa_client_in_main):
268268

269269
# Assert
270270
assert result == expected_response_from_tool
271-
mock_esa_client_in_main.update_post.assert_called_once_with(
272-
post_number=post_number, payload=filtered_payload
273-
)
271+
mock_esa_client_in_main.update_post.assert_called_once_with(post_number=post_number, payload=filtered_payload)
274272

275273

276274
def test_posts_update_success_partial_params(mock_esa_client_in_main):
@@ -293,9 +291,7 @@ def test_posts_update_success_partial_params(mock_esa_client_in_main):
293291

294292
# Assert
295293
assert result == expected_response_from_tool
296-
mock_esa_client_in_main.update_post.assert_called_once_with(
297-
post_number=post_number, payload=filtered_payload
298-
)
294+
mock_esa_client_in_main.update_post.assert_called_once_with(post_number=post_number, payload=filtered_payload)
299295

300296

301297
def test_posts_update_no_params_provided(mock_esa_client_in_main, caplog):

uv.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)