Skip to content

Commit d184ee5

Browse files
committed
test: minor improvements
1 parent 96735d5 commit d184ee5

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

testdata/12103-0400.zip

-17.1 MB
Binary file not shown.

testdata/14103-0200.zip

6.44 MB
Binary file not shown.

testdata/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
このディレクトリに含まれるZIPファイルおよびXMLファイルは、「登記所備付地図データ」(法務省)を、登記所備付地図データ利用規約に基づいて複製したものです。
22

3-
- `12103-0400-*.zip` - [千葉県千葉市稲毛区](https://www.geospatial.jp/ckan/dataset/houmusyouchizu-2022-1-631) (2022年2月1日作成版)
4-
- `15222-1107-1553.xml` - [新潟県上越市](https://www.geospatial.jp/ckan/dataset/houmusyouchizu-2022-1-835) (2022年2月1日作成版)
3+
- `14103-0200.zip` - [神奈川県横浜市西区](https://www.geospatial.jp/ckan/dataset/houmusyouchizu-2022-1-756) (2022-02-01 作成版)
4+
- `12103-0400-76.zip` - [千葉県千葉市稲毛区](https://www.geospatial.jp/ckan/dataset/houmusyouchizu-2022-1-631) (2022-02-01 作成版)
5+
- `15222-1107-1553.xml` - [新潟県上越市](https://www.geospatial.jp/ckan/dataset/houmusyouchizu-2022-1-835) (2022-02-01 作成版)
56

67

78
# 登記所備付地図データ利用規約

tests/test_process.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
)
1212

1313
_FILENAMES = {
14-
"12103-0400.zip": {
15-
"count": 3371,
14+
"14103-0200.zip": {
15+
"count": 446,
1616
},
1717
"15222-1107-1553.xml": {
1818
"count": 1051,
@@ -23,21 +23,21 @@
2323
}
2424

2525

26-
def test_process():
26+
def test_process(tmp_path):
2727
"""Run process"""
2828
for filename in _FILENAMES:
2929
src_path = Path("testdata") / filename
30-
dst_path = src_path.with_suffix(".geojson")
30+
dst_path = (tmp_path / src_path.stem).with_suffix(".geojson")
3131
options = ParseOptions()
3232
executor = ProcessPoolExecutor(options)
3333
files_to_ogr_file([src_path], dst_path, executor)
3434

3535

36-
def test_executors():
36+
def test_executors(tmp_path):
3737
"""Test several executors"""
3838
for executor_cls in [ThreadPoolExecutor, SingleThreadExecutor]:
3939
src_path = Path("testdata") / "15222-1107-1553.xml"
40-
dst_path = src_path.with_suffix(".geojson")
40+
dst_path = (tmp_path / src_path.stem).with_suffix(".geojson")
4141
options = ParseOptions()
4242
executor = executor_cls(options)
4343
files_to_ogr_file([src_path], dst_path, executor)
@@ -56,22 +56,22 @@ def test_iter_features():
5656
assert count == props["count"]
5757

5858

59-
def test_iter_features_arbitrary():
59+
def test_iter_features_arbitrary_crs():
6060
"""Test iter_features with the arbitrary option"""
61-
filename = "12103-0400.zip"
61+
filename = "14103-0200.zip"
6262
src_path = Path("testdata") / filename
6363

6464
options = ParseOptions(include_arbitrary_crs=True)
6565
executor = ProcessPoolExecutor(options)
6666
count = 0
6767
for _ in files_to_feature_iter([src_path], executor):
6868
count += 1
69-
assert count == 71073
69+
assert count == 27237
7070

7171

7272
def test_iter_features_chikugai():
7373
"""Test iter_features with the chikugai option"""
74-
filename = "12103-0400.zip"
74+
filename = "14103-0200.zip"
7575
src_path = Path("testdata") / filename
7676

7777
options = ParseOptions(include_chikugai=True, include_arbitrary_crs=True)
@@ -83,5 +83,5 @@ def test_iter_features_chikugai():
8383
chiban = str(feature["properties"]["地番"])
8484
if "地区外" in chiban or "別図" in chiban:
8585
found_chikugai = True
86-
assert count == 71103
86+
assert count == 27247
8787
assert found_chikugai

0 commit comments

Comments
 (0)