-
Notifications
You must be signed in to change notification settings - Fork 79
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
unit test and something interesting #10
base: main
Are you sure you want to change the base?
Conversation
times.py
Outdated
for start2, end2 in range2: | ||
low = max(start1, start2) | ||
high = min(end1, end2) | ||
overlap_time.append((low, high)) | ||
# bug fixing: only overlapping exists, below min/max range satisfy | ||
if start2<=end1 and end2>=start1: | ||
low = max(start1, start2) | ||
high = min(end1, end2) | ||
overlap_time.append((low, high)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a bug in original code, we must ensure there is a reasonable overlap here
test_times.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_times.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utilize the pytest.mark.parametrize to dry the multi tests
Answers UCL-COMP0233-24-25/RSE-Classwork#16
Load the yaml file within the test and use it that structure to feed the parametrize test. |
Mocking a web service for the International Space Station |
Answers UCL-COMP0233-24-25/RSE-Classwork#11
in the test_times.py, if import the original codes as 'from .times import *', would raise error when testing; Strange because it is also correct format as import.