From a159c974dc33b6e7e3a3efab57f4403172ac08d9 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 18 Mar 2022 15:27:12 +0000 Subject: [PATCH] name output_file with input_file --- tests/test_filter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_filter.py b/tests/test_filter.py index 9f4b34a8..ed785013 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -6,7 +6,17 @@ from etl import filter_mastermap def test_filter_mastermap(): """Test that MasterMap CSV can be correctly filtered to include only buildings.""" input_file = "tests/test_mastermap.gml.csv" # Test csv with one building and one non-building + output_file = input_file.replace('gml', 'filtered') filter_mastermap(input_file) # creates test_mastermap.filtered.csv - with open('tests/test_mastermap.filtered.csv', newline='') as csvfile: + with open(output_file, newline='') as csvfile: csv_array = list(csv.reader(csvfile)) - assert len(csv_array) == 2 # assert that length is 2 because just one row after header \ No newline at end of file + assert len(csv_array) == 2 # assert that length is 2 because just one row after header + + +# def test_filter_mastermap_missing_type(): +# """Test that MasterMap CSV can be correctly filtered when the polygon does not have a type specified.""" +# input_file = "tests/test_mastermap_missing_type.gml.csv" # Test csv with one building and one non-building +# filter_mastermap(input_file) # creates test_mastermap.filtered.csv +# with open('tests/test_mastermap.filtered.csv', newline='') as csvfile: +# csv_array = list(csv.reader(csvfile)) +# assert len(csv_array) == 2 # assert that length is 2 because just one row after header \ No newline at end of file