feat(test): add unit tests for encrypt and time_friendly modules#1163
Open
thecaptain789 wants to merge 3 commits intoeigent-ai:mainfrom
Open
feat(test): add unit tests for encrypt and time_friendly modules#1163thecaptain789 wants to merge 3 commits intoeigent-ai:mainfrom
thecaptain789 wants to merge 3 commits intoeigent-ai:mainfrom
Conversation
- Add pytest configuration to pyproject.toml with dev dependencies - Create test structure mirroring app/component path (per eigent-ai#1039) - Add comprehensive tests for password_hash and password_verify functions - Add tests for to_date and monday_start_time utility functions - Include conftest.py with path setup for proper imports - Cover edge cases: unicode, special chars, None handling Contributes to eigent-ai#1039
Contributor
|
thanks @thecaptain789 's contribution! |
bytecii
reviewed
Feb 5, 2026
Collaborator
bytecii
left a comment
There was a problem hiding this comment.
In general LGTM. Left some comments.
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ========= Copyright 2025-2026 @ Eigent.ai All Rights Reserved. ========= | ||
| """Unit tests for app.component.time_friendly module.""" |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # ========= Copyright 2025-2026 @ Eigent.ai All Rights Reserved. ========= | ||
| """Unit tests for app.component.encrypt module.""" |
| from app.component.time_friendly import monday_start_time, to_date | ||
|
|
||
|
|
||
| class TestToDate: |
Collaborator
There was a problem hiding this comment.
Maybe just use def test_xxx as the tests are quite simple.
| from app.component.encrypt import password_hash, password_verify | ||
|
|
||
|
|
||
| class TestPasswordHash: |
Collaborator
There was a problem hiding this comment.
Maybe just use def test_xxx as the tests are quite simple.
Collaborator
There was a problem hiding this comment.
Can we also remove these init in the tests?
- Convert class-based tests to simple function-based tests - Remove unnecessary __init__.py from test directory - Remove pytest import where not needed
- Remove __init__.py files from test directories - Shorten test function names for clarity
Author
|
Hi @bytecii, thanks for the review! I've addressed your feedback in the latest commits:
Let me know if anything else is needed! |
bytecii
approved these changes
Feb 6, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds comprehensive unit tests for the
app.component.encryptandapp.component.time_friendlymodules.Changes
pyproject.tomltests/app/component/directory structure mirroring source code (per test: create pytest unit tests with clearer mirroring to original code path #1039)Testing
Related Issues
Contributes to #1039 (create pytest unit tests with clearer mirroring to original code path)
Checklist
tests/app/component/test_xxx.pynaming convention