def test_n03(self): """正常系""" url = "http://nlftp.mlit.go.jp/ksj/gml/data/N03/N03-2019/N03-190101_12_GML.zip" gdf = ksj.read_shp(url) actual = gdf.shape expected = (1525, 6) self.assertEqual(expected, actual)
def test_n03(self): """正常系""" url = 'http://nlftp.mlit.go.jp/ksj/gml/data/N03/N03-2019/N03-190101_13_GML.zip' gdf = ksj.read_shp(url) actual = ksj.translate(gdf).columns.tolist() expected = ['都道府県名', '支庁名', '郡政令都市', '市区町村名', '行政区域コード', 'geometry'] self.assertEqual(expected, actual)
def test_a30(self): """正常系""" url = 'http://nlftp.mlit.go.jp/ksj/gml/data/A30a5/A30a5-11/A30a5-11_5340-jgd_GML.zip' gdf = ksj.read_shp(url) actual = gdf.shape expected = (10, 11) self.assertEqual(expected, actual)
def test_a16(self): """正常系、shapefileが破損していてgeojsonしか読めないもの""" url = 'http://nlftp.mlit.go.jp/ksj/gml/data/A16/A16-15/A16-15_01_GML.zip' gdf = ksj.read_shp(url) actual = gdf.shape expected = (119, 12) self.assertEqual(expected, actual)
def test_n03_list(self): """正常系""" url = "http://nlftp.mlit.go.jp/ksj/gml/data/N03/N03-2019/N03-190101_12_GML.zip" gdf = ksj.read_shp(url, return_type="list") actual = type(gdf) expected = list self.assertEqual(expected, actual)