Skip to content

BUG: changed io.wb.get_countries URL #6008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
13 changes: 11 additions & 2 deletions pandas/io/tests/test_wb.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import nose
from nose.tools import assert_equal

import pandas
from pandas.compat import u
from pandas.util.testing import network
from pandas.util.testing import assert_frame_equal
from numpy.testing.decorators import slow
from pandas.io.wb import search, download
from pandas.io.wb import search, download, get_countries
import pandas.util.testing as tm


class TestWB(tm.TestCase):

@slow
Expand All @@ -30,7 +32,6 @@ def test_wdi_search(self):
expected.index = result.index
assert_frame_equal(result, expected)


@slow
@network
def test_wdi_download(self):
Expand All @@ -43,6 +44,14 @@ def test_wdi_download(self):
expected.index = result.index
assert_frame_equal(result, pandas.DataFrame(expected))

@slow
@network
def test_wdi_get_countries(self):
raise nose.SkipTest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are skipping the test?


result = get_countries()
assert_equal(result[-1:].name, 'Zimbabwe')


if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/wb.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _get_data(indicator="NY.GNS.ICTR.GN.ZS", country='US',
def get_countries():
'''Query information about countries
'''
url = 'http://api.worldbank.org/countries/all?format=json'
url = 'http://api.worldbank.org/countries/?per_page=1000&format=json'
with urlopen(url) as response:
data = response.read()
data = json.loads(data)[1]
Expand Down