BUG: get_splits should return empty list, not empty dict

This commit is contained in:
Jean Bredeche
2017-04-22 14:20:15 -04:00
parent fe84ff3582
commit 825866948b
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -401,6 +401,10 @@ class DataPortalTestBase(WithDataPortal,
"Asset 10000 had a trade on fourth minute, so should "
"return that as the last trade on the fifth.")
def test_get_empty_splits(self):
splits = self.data_portal.get_splits([], self.trading_days[2])
self.assertEqual([], splits)
class TestDataPortal(DataPortalTestBase):
DATA_PORTAL_LAST_AVAILABLE_SESSION = None
+1 -1
View File
@@ -1139,7 +1139,7 @@ class DataPortal(object):
List of splits, where each split is a (asset, ratio) tuple.
"""
if self._adjustment_reader is None or not assets:
return {}
return []
# convert dt to # of seconds since epoch, because that's what we use
# in the adjustments db