-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Python CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: pip install .[develop] | ||
- name: Run ruff | ||
run: ruff check src | ||
- name: Run mypy | ||
run: mypy src | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: pip install .[develop] | ||
- name: Run tests with coverage | ||
run: | | ||
coverage run -m pytest src/tests/unit | ||
coverage report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from uuid import UUID | ||
|
||
from core.entities.user import User | ||
from application.entities.user import User | ||
|
||
|
||
def test_user_creation(): | ||
def test_user_creation() -> None: | ||
user = User( | ||
name="Alice Smith", email="[email protected]", password="securepassword", confirmed=False | ||
) | ||
|
@@ -15,7 +15,7 @@ def test_user_creation(): | |
assert isinstance(user.id, UUID) | ||
|
||
|
||
def test_user_default_id(): | ||
def test_user_default_id() -> None: | ||
user1 = User( | ||
name="Alice Smith", email="[email protected]", password="securepassword", confirmed=False | ||
) | ||
|
@@ -26,7 +26,7 @@ def test_user_default_id(): | |
assert user1.id != user2.id | ||
|
||
|
||
def test_user_email_format(): | ||
def test_user_email_format() -> None: | ||
user = User( | ||
name="Alice Smith", email="[email protected]", password="securepassword", confirmed=False | ||
) | ||
|
@@ -35,7 +35,7 @@ def test_user_email_format(): | |
assert "." in user.email.split("@")[-1] | ||
|
||
|
||
def test_user_confirmation(): | ||
def test_user_confirmation() -> None: | ||
user = User( | ||
name="Alice Smith", email="[email protected]", password="securepassword", confirmed=True | ||
) | ||
|