diff --git a/tests/test_filter.py b/tests/test_filter.py index 16284657..3c4f3a72 100644 --- a/tests/test_filter.py +++ b/tests/test_filter.py @@ -5,12 +5,12 @@ 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 + input_file = "tests/test_mastermap.gml.csv" # Test csv with two buildings and one non-building output_file = input_file.replace('gml', 'filtered') filter_mastermap(input_file) # creates output_file 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 + assert len(csv_array) == 3 # assert that length is 3 because just two building rows after header def test_filter_mastermap_missing_descriptivegroup(): diff --git a/tests/test_mastermap.gml.csv b/tests/test_mastermap.gml.csv index d76a6eee..9837036b 100644 --- a/tests/test_mastermap.gml.csv +++ b/tests/test_mastermap.gml.csv @@ -1,3 +1,4 @@ WKT,fid,descriptiveGroup "POLYGON ((484704.003 184721.2,484691.62 184729.971,484688.251 184725.214,484700.633 184716.443,484704.003 184721.2))",osgb5000005129953843,"[ ""Building"" ]" -"POLYGON ((484703.76 184849.9,484703.46 184849.7,484703.26 184849.4,484703.06 184849.2,484702.86 184848.9,484702.76 184848.6,484702.66 184848.2,484702.66 184847.3,484702.76 184847.0,484702.96 184846.7,484703.06 184846.4,484703.36 184846.2,484703.56 184846.0,484704.16 184845.6,484704.46 184845.5,484705.46 184845.5,484706.06 184845.7,484706.26 184845.8,484706.76 184846.3,484706.96 184846.6,484707.16 184846.8,484707.26 184847.2,484707.36 184847.5,484707.36 184848.4,484707.26 184848.7,484707.16 184848.9,484706.76 184849.5,484706.46 184849.7,484706.26 184849.9,484705.66 184850.2,484704.66 184850.2,484703.76 184849.9))",osgb1000000152730957,"[ ""General Surface"" ]" \ No newline at end of file +"POLYGON ((484703.76 184849.9,484703.46 184849.7,484703.26 184849.4,484703.06 184849.2,484702.86 184848.9,484702.76 184848.6,484702.66 184848.2,484702.66 184847.3,484702.76 184847.0,484702.96 184846.7,484703.06 184846.4,484703.36 184846.2,484703.56 184846.0,484704.16 184845.6,484704.46 184845.5,484705.46 184845.5,484706.06 184845.7,484706.26 184845.8,484706.76 184846.3,484706.96 184846.6,484707.16 184846.8,484707.26 184847.2,484707.36 184847.5,484707.36 184848.4,484707.26 184848.7,484707.16 184848.9,484706.76 184849.5,484706.46 184849.7,484706.26 184849.9,484705.66 184850.2,484704.66 184850.2,484703.76 184849.9))",osgb1000000152730957,"[ ""General Surface"" ]" +"POLYGON ((530022.138 177486.29,530043.695 177498.235,530043.074 177499.355,530042.435 177500.509,530005.349 177480.086,529978.502 177463.333,529968.87 177457.322,529968.446 177457.057,529968.199 177455.714,529968.16 177455.504,529966.658 177454.566,529958.613 177449.543,529956.624 177448.301,529956.62 177448.294,529956.08 177447.4,529954.238 177444.351,529953.197 177442.624,529953.186 177442.609,529950.768 177438.606,529950.454 177438.086,529949.47 177434.209,529950.212 177434.038,529954.216 177433.114,529955.098 177437.457,529952.714 177437.98,529953.55 177441.646,529953.842 177442.008,529957.116 177446.059,529957.449 177446.471,529968.508 177453.375,529974.457 177451.966,529976.183 177458.937,530003.157 177475.772,530020.651 177485.466,530021.257 177484.372,530022.744 177485.196,530022.138 177486.29))",osgb5000005283023887,"[ ""Building"" ]" \ No newline at end of file