Skip to content

Commit

Permalink
Add test of times.py Answers UCL-RITS/rsd-classwork-2020#61
Browse files Browse the repository at this point in the history
  • Loading branch information
liamchalcroft committed Nov 4, 2020
1 parent 1642a86 commit b3abfdb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions week05-testing/test_times.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import times

def test_given_input():
large = times.time_range("2010-01-12 10:00:00", "2010-01-12 12:00:00")
short = times.time_range("2010-01-12 10:30:00", "2010-01-12 10:45:00", 2, 60)
result = times.compute_overlap_time(large, short)
expected = [('2010-01-12 10:30:00', '2010-01-12 10:37:00'),
('2010-01-12 10:38:00', '2010-01-12 10:45:00')]
assert result == expected

0 comments on commit b3abfdb

Please sign in to comment.