Skip to content

Commit

Permalink
Adds test for robinhood#674 that fails only on Cython
Browse files Browse the repository at this point in the history
  • Loading branch information
forsberg committed Oct 21, 2020
1 parent 15febb2 commit e3f8c02
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions t/unit/windows/test_hopping_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,19 @@ def test_stale_timestamp(self):
for time in range(0, now_timestamp - expires):
print(f'TIME: {time} NOW TIMESTAMP: {now_timestamp}')
assert window.stale(time, now_timestamp) is True

def test_ranges_types(self):
size = 60
step = 60
window = HoppingWindow(size, step)

# There's nothing special about this timestamp,
# it was simply when the test was created
timestamp = 1603122451.544989
window_ranges = window.ranges(timestamp)

assert len(window_ranges) == 1
assert type(window_ranges[0][0]) == float
assert type(window_ranges[0][1]) == float
assert window_ranges[0][0] == approx(1603122420.0)
assert window_ranges[0][1] == approx(1603122479.9)

0 comments on commit e3f8c02

Please sign in to comment.