Skip to content

Commit

Permalink
Multiple series (#17)
Browse files Browse the repository at this point in the history
* test for multiple series

* fixed mistaken assumption about how requests handles series
  • Loading branch information
OliverSherouse authored Jun 13, 2018
1 parent 041e476 commit 1f1b40d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bls/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def unset_api_key():

def _get_json_subset(series, startyear, endyear, key):
data = {
"seriesid": series,
"seriesid": ','.join(series),
"startyear": startyear,
"endyear": endyear
}
Expand Down
16 changes: 16 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime

import bls
import pandas as pd
import pytest


Expand All @@ -18,6 +19,21 @@ def test_monthly_value():
)['1948-01'] == 3.4


def test_monthly_value_multiple():
assert (
bls.get_series(
['LNS14000000', 'LNS14000001'], startyear=1948, endyear=1948
)
.xs('1948-01')
.equals(
pd.Series({
'LNS14000000': 3.4,
'LNS14000001': 3.4
})
)
)


def test_quarterly_value():
assert bls.get_series(
'CIU2020000000000A', startyear=2001, endyear=2001
Expand Down

0 comments on commit 1f1b40d

Please sign in to comment.