1
0
mirror of https://github.com/bspeice/metrik synced 2025-07-01 22:07:03 -04:00

Add a trading day timedelta

This commit is contained in:
Bradlee Speice
2016-08-16 16:06:59 -04:00
parent cd7009729e
commit d581ddf780
2 changed files with 38 additions and 0 deletions

17
test/test_trading_days.py Normal file
View File

@ -0,0 +1,17 @@
from unittest import TestCase
from datetime import datetime
from metrik.trading_days import TradingDay
class TradingDayTest(TestCase):
def test_skip_july4(self):
start = datetime(2016, 7, 1) # Friday
end = start + TradingDay(1)
assert end == datetime(2016, 7, 5)
def test_skip_july4_backwards(self):
end = datetime(2016, 7, 5)
start = end - TradingDay(1)
assert start == datetime(2016, 7, 1)