Skip to content

Commit

Permalink
TST: Test for bad na argument to to_json()
Browse files Browse the repository at this point in the history
  • Loading branch information
kjordahl committed Apr 21, 2014
1 parent 8aaad9d commit cf2d13c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_geodataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ def test_to_json_na(self):
if props['BoroName'] == 'Queens':
self.assertTrue(props['Shape_Area'] is None)

def test_to_json_bad_na(self):
# Check that a bad na argument raises error
with self.assertRaises(ValueError):
text = self.df.to_json(na='garbage')

def test_to_json_dropna(self):
self.df['Shape_Area'][self.df['BoroName']=='Queens'] = np.nan
self.df['Shape_Leng'][self.df['BoroName']=='Bronx'] = np.nan
Expand Down

0 comments on commit cf2d13c

Please sign in to comment.