Skip to content
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

Test random indicators and intercept JSONDecodeError #11

Merged
merged 2 commits into from
Jul 9, 2019

Conversation

mwouts
Copy link
Owner

@mwouts mwouts commented Jul 9, 2019

As suggested by @bcipolli at #7.

With this update, we get the following output:

ENF.CONT.COEN.CSMG: OK
IN.IS.RRS.PASG.KM.SUB: OK
UIS.NAR.2: OK
FB.FCP.INST.CB.PD.SW: OK
IP.TMK.RSCT: OK
IT.NET.BNDW.PC: OK
per_lm_pa.adq_q2_preT_tot: OK
NV.IND.MANF.KD.87: ERROR:
The indicator was not found. It may have been deleted or archived.
url=http://api.worldbank.org/v2/country/all/indicator/NV.IND.MANF.KD.87
params={'mrv': 1, 'format': 'jsonstat', 'per_page': 20000}
SABER.WORK.GOAL2: OK
IN.EC.POP.RURL.PCT: OK
SE.SEC.PROG.MA.ZS: OK
SN.ITK.VITA.Q5.ZS: OK

for this code snippet:

import sys
import random
import world_bank_data as wb

all_indics = wb.get_indicators()

random.seed(2019)
for indicator in random.sample(all_indics.index.tolist(), 12):
    sys.stdout.write(indicator + ':')
    try:
        value = wb.get_series(indicator, mrv=1)
        sys.stdout.write(' OK\n')
    except ValueError as err:
        sys.stdout.write(' ERROR:\n')
        sys.stdout.write(str(err) + '\n')

@codecov-io
Copy link

codecov-io commented Jul 9, 2019

Codecov Report

Merging #11 into master will increase coverage by <.01%.
The diff coverage is 96%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
+ Coverage   95.91%   95.92%   +<.01%     
==========================================
  Files          16       16              
  Lines         392      417      +25     
==========================================
+ Hits          376      400      +24     
- Misses         16       17       +1
Impacted Files Coverage Δ
tests/test_indicator.py 96.42% <100%> (+0.84%) ⬆️
world_bank_data/request.py 94.79% <88.88%> (-0.62%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3205e38...79c8007. Read the comment docs.

@mwouts mwouts merged commit 01ea7eb into master Jul 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants