-
Notifications
You must be signed in to change notification settings - Fork 34
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
Created test file. #16
base: main
Are you sure you want to change the base?
Conversation
Shout-out to @shashvatshukla for his many insights |
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.
This is a good start!
I've made some comments that hopefully help you move in the right direction with the remaining things that need sorting out 🙂
short = time_range("2011-01-12 10:30:00", "2011-01-12 10:45:00", 2, 60) | ||
print(compute_overlap_time(large, short)) | ||
result = compute_overlap_time(large, short) | ||
expected = [] |
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.
Why do you expect the overlap between large
and short
to be []
here?
assert result == expected | ||
|
||
|
||
test_given_input() |
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.
You don't need this here - pytest
will automatically find and run functions whose name starts with test
!
@@ -18,9 +22,12 @@ def compute_overlap_time(range1, range2): | |||
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.
Should we add an overlap to the overlap_time
list if low > high
?
@@ -0,0 +1,7 @@ | |||
{ |
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.
This file (and the two .pyc
files below) should not be tracked by git! They are specific to your local set-up (which is probably different to everyone elses!)...See gitignore
!
VS code supports testing with pytest- makes my life a lot better