fixed catastrophic bug in load_from_directory

and added a new test case
was not iterating over lookup date directory names, and
therefore mising all by one list of stocks.
discovered because of differing sort orders between
my local machine, other devs, and travis ci.
This commit is contained in:
fawce
2015-02-05 13:57:41 -05:00
parent 08a0d1b604
commit 412baa3c3f
2 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -127,8 +127,8 @@ def load_from_directory(list_name):
tzinfo=pytz.utc)
data[kd] = {}
kd_path = os.path.join(dir_path, kd_name)
for ld_name in listdir(os.path.join(dir_path, kd_name)):
ld = datetime.strptime(kd_name, DATE_FORMAT).replace(
for ld_name in listdir(kd_path):
ld = datetime.strptime(ld_name, DATE_FORMAT).replace(
tzinfo=pytz.utc)
data[kd][ld] = {}
ld_path = os.path.join(kd_path, ld_name)