From 68efdb63cbc908988fffbd13b6d4c2b5ab45d84e Mon Sep 17 00:00:00 2001 From: Roel Huybrechts Date: Tue, 11 Jun 2024 13:43:04 +0200 Subject: [PATCH] Fix GMLObject tests. --- tests/test_util_location.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/test_util_location.py b/tests/test_util_location.py index 292dcc20..c356665d 100644 --- a/tests/test_util_location.py +++ b/tests/test_util_location.py @@ -218,14 +218,13 @@ def test_gmlobject_no_gml(self): Test whether an ValueError is raised. """ - with open('tests/data/types/boring/boring.xml', 'r') as xmlfile: + with open('tests/data/types/interpretaties/gecodeerde_lithologie/' + 'gecodeerde_lithologie.xml', 'r') as xmlfile: xml = xmlfile.read() - with pytest.raises(ValueError) as error: + with pytest.raises(ValueError, match='not to be valid GML3.2'): GmlObject(xml) - assert 'not to be valid GML3.2' in error - def test_gmlobject_old_gml(self): """Test the GmlObject type with XML that is GML 3.1.1 @@ -236,11 +235,9 @@ def test_gmlobject_old_gml(self): 'r') as xmlfile: xml = xmlfile.read() - with pytest.raises(ValueError) as error: + with pytest.raises(ValueError, match='older'): GmlObject(xml) - assert 'older' in error - class TestBinarySpatialFilters(object): """Class grouping tests for the AbstractBinarySpatialFilter subtypes."""