File tree Expand file tree Collapse file tree 4 files changed +33
-7
lines changed
Expand file tree Collapse file tree 4 files changed +33
-7
lines changed Original file line number Diff line number Diff line change 2828 - uses : actions/setup-python@v5
2929 with :
3030 python-version : " 3.12"
31+ cache : " pytest"
32+ - run : |
33+ python -m pytest
3134
3235 - name : Install and configure Poetry
3336 uses : snok/install-poetry@v1
4649 if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
4750 run : poetry install --no-interaction
4851
49- - name : Run tests
50- run : poetry run pytest
51-
5252 - uses : aws-actions/configure-aws-credentials@v4
5353 with :
5454 aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
Original file line number Diff line number Diff line change 2020 - uses : actions/setup-python@v5
2121 with :
2222 python-version : " 3.12"
23- cache : " poetry "
23+ cache : " pytest "
2424 - name : Run tests
2525 run : |
26- pip install poetry
27- poetry install --no-interaction
28- poetry run pytest
26+ python -m pytest
Original file line number Diff line number Diff line change 7777 " !Split" ,
7878 " !Join sequence"
7979 ],
80+ "python.testing.pytestArgs" : [
81+ " tests"
82+ ],
8083}
Original file line number Diff line number Diff line change 1+ import pytest
2+ from pydantic import ValidationError
3+
4+ from app .auth .models import SignUpData
5+
6+
7+ def test_signup_data_valid ():
8+ data = SignUpData (email = "test@example.com" , password = "strongpassword123" )
9+ assert data .email == "test@example.com"
10+ assert data .password == "strongpassword123"
11+
12+
13+ def test_signup_data_invalid_email ():
14+ with pytest .raises (ValidationError ):
15+ SignUpData (email = "invalid-email" , password = "strongpassword123" )
16+
17+
18+ def test_signup_data_missing_email ():
19+ with pytest .raises (ValidationError ):
20+ SignUpData (password = "strongpassword123" )
21+
22+
23+ def test_signup_data_missing_password ():
24+ with pytest .raises (ValidationError ):
25+ SignUpData (email = "test@example.com" )
You can’t perform that action at this time.
0 commit comments