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

Created test file. #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SolemnShark871
Copy link

VS code supports testing with pytest- makes my life a lot better

@SolemnShark871
Copy link
Author

Shout-out to @shashvatshukla for his many insights

Copy link
Contributor

@alessandrofelder alessandrofelder left a 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 = []
Copy link
Contributor

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()
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ bug here 🐛 ⚠️ !
Should we add an overlap to the overlap_time list if low > high?

@@ -0,0 +1,7 @@
{
Copy link
Contributor

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!

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.

2 participants