Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 157 #173

Closed
wants to merge 16 commits into from
Closed

Issue 157 #173

wants to merge 16 commits into from

Conversation

chaitanya-rdY
Copy link
Contributor

Pull Request
Description
This PR refactors the TimeWindowMixin class to improve validation logic for interval start and end times, ensuring they adhere to the specified constraints. It fixes issues where invalid intervals or divisibility violations were not being properly handled. The validation errors now properly trigger when an invalid configuration is provided. Additionally, the test cases for these validations were added to ensure robustness and accuracy.

Fixes #157

How Has This Been Tested?
The changes were tested using unit tests. The following tests were run to verify the new validation logic:

Valid Time Window Test:

A valid configuration where interval_start_minutes and interval_end_minutes satisfy the correct conditions.
Expected behavior: No errors raised, test passed.
Invalid Time Window Test:

A configuration where interval_start_minutes exceeds interval_end_minutes. This should trigger a validation error.
Expected behavior: A ValidationError is raised with the correct error message.
Divisibility Check Test:

A configuration where interval_start_minutes is not divisible by the specified time_resolution_minutes. This should trigger a validation error.
Expected behavior: A ValidationError is raised indicating that the start time must be divisible by the time resolution.

Checklist:
My code follows OCF's coding style guidelines
I have performed a self-review of my own code
I have made corresponding changes to the documentation
I have added tests that prove my fix is effective or that my feature works
I have checked my code and corrected any misspellings

@chaitanya-rdY
Copy link
Contributor Author

@Sukh-P,please resolve this error.

chaitanya reddy palem added 3 commits February 15, 2025 00:10
@chaitanya-rdY chaitanya-rdY deleted the Issue_157 branch February 15, 2025 08:03
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.

condense validation in config
1 participant