Commit faa05c2
Add unit tests (#32)
* Add password validation tests and update devcontainer to run tests on start
* Add test to ensure tampered password fails verification
* Nest unit tests and rename `utility.py` -> `utils.py`
* Add initial routes module for organizing route handlers
* Add GitHub Actions workflow for testing across multiple Python versions and OS
* Refactor GitHub Actions workflow to combine dependency installation and testing steps
* Remove redundant test command from GitHub Actions workflow
* Update GitHub Actions workflow to run tests on multiple OS environments
* Refactor GitHub Actions workflow to consolidate OS matrix for testing
* Refactor GitHub Actions workflow to specify branch for push events and streamline test job configuration
* Rename workflow from "Python package" to "Pytest CI" and remove branch specification for push events
* Add Python 3.x to the testing matrix in GitHub Actions workflow
* Simplify Python version specification in GitHub Actions workflow to use "3.x"
* Update Python version specification to use a list format in GitHub Actions workflow
* Add descriptive comment for OS and Python versions in GitHub Actions workflow
* Revert "Add descriptive comment for OS and Python versions in GitHub Actions workflow"
This reverts commit 4eb0780.
* Add branch filter for main in GitHub Actions workflow
* Refactor imports in person.py and define __all__ in utils.py for better module management
* Add branch filter for main in Pytest CI workflow
* Add RunOnSave extension and configure pytest command for test files
* Update RunOnSave configuration to improve test file matching and output handling
* Add file exclusion settings for __pycache__ and .pytest_cache in VSCode
* Refactor utility imports and reorganize test structure
* Remove obsolete test for index route in test_home.py
* Refactor index route test to use a pytest fixture for the test client
* Add tests for email encryption and hashing utilities; refactor password hashing tests
* Refactor decrypt_email tests to separate type and value assertions
* Remove unused import of register_routes in test_routes initialization
* Refactor index route test to separate status code and JSON response assertions
* Update image upload folder path and ensure directory creation for new location
* Update picture route to use Config.IMAGES_FOLDER for file handling
* Rename upload folder from 'images' to 'pictures' in .gitignore
* Add tests for user registration with missing fields
* Update postStartCommand in devcontainer.json for verbose pytest output
* Add email validation to registration and update utility functions
* Add tests for user registration and login with missing fields
* Fix email validation regex and add comprehensive tests for valid and invalid email formats
* Add additional tests for email validation to cover edge cases
* Add docstring to extract_error_message for clarity on functionality
* Update email validation regex and add git fetch command in VSCode settings
* Add email masking functionality and corresponding tests
* Refactor authentication tests to use fixtures for sample data and improve test clarity
* Remove git fetch command from VSCode settings to streamline run-on-save functionality
* Remove verbosity from postStartCommand in devcontainer configuration
* Refactor JWT helper functions and add comprehensive tests for refresh token functionality
* Update GitHub Actions workflow to define permissions for test job
* Run Prettier
* Add utility tests for email and password handling, including hashing and masking
* Remove unused imports in refresh token test file
* Start adding tests for access token generation and create test fixtures
* Add tests for access token decoding and expiration validation
* Add tests for extracting and generating JWT refresh tokens
* Add fixtures and tests for access and refresh token handling
* Remove redundant tests for token extraction and validation
* Remove unused access token generation imports from test files
* Refactor imports in test_verify_token.py to remove unused functions
* Update routes/picture.py
Co-authored-by: Copilot <[email protected]>
* Fix test for missing username in registration by updating test data
* Enhance GitHub Actions workflow by adding descriptive job name for Pytest
* Fix test comment
* Update tests/test_jwt/test_refresh_access_token.py
Co-authored-by: Copilot <[email protected]>
* Improve JWT token tests
* Update tests/test_routes/test_authentication/test_login.py
Co-authored-by: Copilot <[email protected]>
* Fix test for missing password by changing username to email in test_login.py
* Refactor refresh token tests: consolidate and enhance test coverage
---------
Co-authored-by: Copilot <[email protected]>1 parent d910cbd commit faa05c2
File tree
37 files changed
+823
-52
lines changed- .devcontainer
- .github/workflows
- .vscode
- routes
- tests
- test_jwt
- test_routes
- test_authentication
- test_utility
- test_email
- test_password
37 files changed
+823
-52
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
22 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 30 | + | |
| 31 | + | |
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | | - | |
27 | | - | |
| 23 | + | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
| |||
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 34 | + | |
41 | 35 | | |
42 | 36 | | |
43 | 37 | | |
| |||
48 | 42 | | |
49 | 43 | | |
50 | 44 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 45 | + | |
54 | 46 | | |
55 | 47 | | |
56 | 48 | | |
57 | 49 | | |
58 | 50 | | |
59 | 51 | | |
60 | 52 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 53 | + | |
64 | 54 | | |
65 | 55 | | |
66 | 56 | | |
| |||
73 | 63 | | |
74 | 64 | | |
75 | 65 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 66 | + | |
79 | 67 | | |
80 | 68 | | |
81 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
Whitespace-only changes.
0 commit comments