2727
2828import datacommons as dc
2929import datacommons .utils as utils
30+ import math
3031import json
3132import unittest
3233import six
@@ -273,6 +274,9 @@ def test_opt_args(self, urlopen):
273274 'CensusPEPSurvey' , 'P1Y' , 'RealPeople' , 100 )
274275 self .assertEqual (stat , 103 )
275276
277+ # Call get_stat_series with bogus required args
278+ stat = dc .get_stat_value ('foofoo' , 'barrbar' )
279+ self .assertTrue (math .isnan (stat ))
276280
277281class TestGetStatSeries (unittest .TestCase ):
278282 """Unit tests for get_stat_series."""
@@ -293,6 +297,10 @@ def test_opt_args(self, urlopen):
293297 'CensusPEPSurvey' , 'P1Y' , 'RealPeople' , 100 )
294298 self .assertEqual (stats , {"2000" : 3 , "2001" : 42 })
295299
300+ # Call get_stat_series with bogus required args
301+ stats = dc .get_stat_series ('foofoofoo' , 'barfoobar' )
302+ self .assertEqual (stats , {})
303+
296304 # Call get_stat_series with non-satisfiable optional args
297305 stats = dc .get_stat_series ('geoId/06' , 'Count_Person' , 'DNE' )
298306 self .assertEqual (stats , {})
0 commit comments