mirror of
https://github.com/wassname/geopandas.git
synced 2026-09-11 12:10:59 +08:00
TST: Test for bad na argument to to_json()
This commit is contained in:
@@ -236,6 +236,11 @@ class TestDataFrame(unittest.TestCase):
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user