Skip to content

Add unit tests for operator.py - #589

Merged
aatmanvaidya merged 1 commit into
tattle-made:developmentfrom
SarthakB11:add-unit-test-operator
Apr 21, 2025
Merged

aatmanvaidya merged 1 commit into
tattle-made:developmentfrom
SarthakB11:add-unit-test-operator

Conversation

@SarthakB11

Copy link
Copy Markdown
Contributor

Under this PR, I have added comprehensive unit tests for the operator.py file as requested in issue #555.

Overview

The operator.py file is responsible for loading operators from the configuration file, importing their modules, and initializing them. My unit tests ensure that this functionality works correctly.

Changes I Made

  1. Created a new test file tests/feluda_unit_tests/test_operator.py that includes tests for:

    • Operator initialization
    • Setting up operators from configuration
    • Handling empty operator lists
    • Getting active operators
    • Error handling for import errors
    • Error handling for initialization errors
  2. Used unittest and mock to test the functionality without actual imports

  3. Followed the project's existing testing patterns and style conventions

This PR helps improve the overall test coverage of the codebase and ensures that the operator module works as expected.

Testing

All tests pass using

uv run -m unittest discover -s tests/feluda_unit_tests -p 'test_*.py'

Closes #555

@aatmanvaidya
aatmanvaidya self-requested a review April 21, 2025 08:03
@aatmanvaidya aatmanvaidya linked an issue Apr 21, 2025 that may be closed by this pull request
@aatmanvaidya
aatmanvaidya merged commit b4ee30e into tattle-made:development Apr 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit test for operator.py

2 participants