From 120886a2b7452eac1b905e6f67cc44f504241572 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:22 +0200 Subject: [PATCH 01/15] Update pytest from 2.8.5 to 3.2.2 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index caeeb19..317dfdf 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ --requirement requirements.txt # Testing -pytest==2.8.5 +pytest==3.2.2 pytest-cov==2.2.0 coveralls==1.1 flake8==2.5.4 From d1b85edd7d27da56dc5c2b7a5da1ec3cbaa2a442 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:24 +0200 Subject: [PATCH 02/15] Update pytest-cov from 2.2.0 to 2.5.1 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 317dfdf..98b976c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,7 +3,7 @@ # Testing pytest==3.2.2 -pytest-cov==2.2.0 +pytest-cov==2.5.1 coveralls==1.1 flake8==2.5.4 mock==2.0.0 \ No newline at end of file From 2c0a0383d0ef48ec178ffc2a9a0f232f88d60074 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:25 +0200 Subject: [PATCH 03/15] Update coveralls from 1.1 to 1.2.0 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 98b976c..d7a4d59 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,6 +4,6 @@ # Testing pytest==3.2.2 pytest-cov==2.5.1 -coveralls==1.1 +coveralls==1.2.0 flake8==2.5.4 mock==2.0.0 \ No newline at end of file From f5354acc87168778a36e3a99e8e4e819c2b8725a Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:27 +0200 Subject: [PATCH 04/15] Update flake8 from 2.5.4 to 3.4.1 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d7a4d59..bf8eff8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,5 +5,5 @@ pytest==3.2.2 pytest-cov==2.5.1 coveralls==1.2.0 -flake8==2.5.4 +flake8==3.4.1 mock==2.0.0 \ No newline at end of file From 7541ba71715c0d7563e3fa9aca711064d5d307c6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:28 +0200 Subject: [PATCH 05/15] Update requests from 2.13.0 to 2.18.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 94ac0c6..e8cd8ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -requests==2.13.0 +requests==2.18.4 suds-jurko==0.6 dogpile.cache==0.5.7 six==1.10.0 From 5e0ed47af9f1a83bd66e05ed3bdb2b0ff8eac5a6 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:29 +0200 Subject: [PATCH 06/15] Update dogpile.cache from 0.5.7 to 0.6.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e8cd8ed..c6a7a19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ requests==2.18.4 suds-jurko==0.6 -dogpile.cache==0.5.7 +dogpile.cache==0.6.4 six==1.10.0 zope.deprecation==4.2.0 From fee37f5bb211683afd3d83e10a9908d626ae0b2e Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Fri, 15 Sep 2017 14:27:31 +0200 Subject: [PATCH 07/15] Update zope.deprecation from 4.2.0 to 4.3.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c6a7a19..078f53f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ requests==2.18.4 suds-jurko==0.6 dogpile.cache==0.6.4 six==1.10.0 -zope.deprecation==4.2.0 +zope.deprecation==4.3.0 From 6be168bf06e6c9d613b44abd856c1321c56e2b8a Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 10:21:41 +0200 Subject: [PATCH 08/15] Fix failing test. Refs #80 --- tests/gateway/test_crab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index cc8d25d..68d2f97 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -1613,7 +1613,7 @@ def test_lazy_load(self): t = Terreinobject("13040_C_1747_G_002_00", 1) t.set_gateway(crab) assert t.id == "13040_C_1747_G_002_00" - assert t.centroid == (190708.59, 224667.59) + assert t.centroid == (190708.6, 224667.59) assert t.bounding_box == (190700.24, 224649.87, 190716.95, 224701.7) assert int(t.aard.id) == 1 t.metadata.set_gateway(crab) @@ -1673,7 +1673,7 @@ def test_lazy_load(self): p = Perceel("13040C1747/00G002") p.set_gateway(crab) assert p.id == "13040C1747/00G002" - assert p.centroid == (190708.59, 224667.59) + assert p.centroid == (190708.6, 224667.59) p.metadata.set_gateway(crab) assert isinstance(p.metadata, Metadata) assert p.metadata.begin_datum is not None From ea3d218e4da6b3b9bdce6addc2a6060689aefd80 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 11:14:39 +0200 Subject: [PATCH 09/15] Update tests. Refs #80 --- tests/.cache/v/cache/lastfailed | 7 +++++++ tests/gateway/test_crab.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tests/.cache/v/cache/lastfailed diff --git a/tests/.cache/v/cache/lastfailed b/tests/.cache/v/cache/lastfailed new file mode 100644 index 0000000..37f27da --- /dev/null +++ b/tests/.cache/v/cache/lastfailed @@ -0,0 +1,7 @@ +{ + "gateway/test_capakey.py::TestCapakeyRestGateway::()::test_list_afdelingen": true, + "gateway/test_capakey.py::TestPerceel::()::test_lazy_load": true, + "gateway/test_crab.py::TestCrabGateway::()::test_get_huisnummer_by_nummer_and_straat": true, + "gateway/test_crab.py::TestCrabGateway::()::test_list_huisnummers_by_perceel_empty": true, + "gateway/test_crab_cached.py::TestCrabCachedGateway::()::test_list_aardterreinobjecten_different_sort": true +} \ No newline at end of file diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index 68d2f97..69dc5a8 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -1613,7 +1613,7 @@ def test_lazy_load(self): t = Terreinobject("13040_C_1747_G_002_00", 1) t.set_gateway(crab) assert t.id == "13040_C_1747_G_002_00" - assert t.centroid == (190708.6, 224667.59) + assert t.centroid == (190707.77, 224673.21) assert t.bounding_box == (190700.24, 224649.87, 190716.95, 224701.7) assert int(t.aard.id) == 1 t.metadata.set_gateway(crab) @@ -1673,7 +1673,7 @@ def test_lazy_load(self): p = Perceel("13040C1747/00G002") p.set_gateway(crab) assert p.id == "13040C1747/00G002" - assert p.centroid == (190708.6, 224667.59) + assert p.centroid == (190707.77, 224673.21) p.metadata.set_gateway(crab) assert isinstance(p.metadata, Metadata) assert p.metadata.begin_datum is not None From 0a2139bd4b00c379dcbe01c53822e81e33b2316a Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 13:57:27 +0200 Subject: [PATCH 10/15] Fix nonsensical tests. --- tests/gateway/test_capakey.py | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tests/gateway/test_capakey.py b/tests/gateway/test_capakey.py index 5a889d3..459eb46 100644 --- a/tests/gateway/test_capakey.py +++ b/tests/gateway/test_capakey.py @@ -319,20 +319,17 @@ def test_fully_initialised(self): (104154.2225, 197300.703), (94653.453, 185680.984, 113654.992, 208920.422) ) - assert (g.id, 44021) - assert (g.naam, 'Gent') - assert (g.centroid, (104154.2225, 197300.703)) - assert ( - g.bounding_box, - (94653.453, 185680.984, 113654.992, 208920.422) - ) - assert ('Gent (44021)', str(g)) - assert ("Gemeente(44021, 'Gent')", repr(g)) + assert g.id == 44021 + assert g.naam == 'Gent' + assert g.centroid == (104154.2225, 197300.703) + assert g.bounding_box == (94653.453, 185680.984, 113654.992, 208920.422) + assert 'Gent (44021)' == str(g) + assert "Gemeente(44021, 'Gent')" == repr(g) def test_str_and_repr_dont_lazy_load(self): g = Gemeente(44021, 'Gent') - assert ('Gent (44021)', str(g)) - assert ("Gemeente(44021, 'Gent')", repr(g)) + assert 'Gent (44021)' == str(g) + assert "Gemeente(44021, 'Gent')" == repr(g) def test_check_gateway_not_set(self): g = Gemeente(44021, 'Gent') @@ -506,7 +503,7 @@ def test_fully_initialised(self): assert s.id == 'A' assert s.centroid == (104893.06375, 196022.244094) assert s.bounding_box == (104002.076625, 194168.3415, 105784.050875, 197876.146688) - assert ('Gent 1 AFD (44021), Sectie A', str(s)) + assert 'Gent 1 AFD (44021), Sectie A' == str(s) assert "Sectie('A', Afdeling(44021, 'Gent 1 AFD'))" == repr(s) def test_check_gateway_not_set(self): From 6c9c9f8aee58332199682142e6f92d040cb0a4c6 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 14:34:43 +0200 Subject: [PATCH 11/15] Fix more tests --- tests/gateway/test_capakey_cached.py | 4 +-- tests/gateway/test_crab.py | 37 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/tests/gateway/test_capakey_cached.py b/tests/gateway/test_capakey_cached.py index 528d83f..649d18b 100644 --- a/tests/gateway/test_capakey_cached.py +++ b/tests/gateway/test_capakey_cached.py @@ -84,7 +84,7 @@ def test_get_kadastrale_afdeling_by_id(self, capakey_gateway): def test_list_secties_by_afdeling_id(self, capakey_gateway): res = capakey_gateway.list_secties_by_afdeling(44021) assert isinstance(res, list) - assert (len(res), 1) + assert len(res) == 1 assert capakey_gateway.caches['long'].get('ListKadSectiesByKadAfdelingcode#44021') == res def test_get_sectie_by_id_and_afdeling(self, capakey_gateway): @@ -202,7 +202,7 @@ def test_get_kadastrale_afdeling_by_id(self, capakey_rest_gateway): def test_list_secties_by_afdeling_id(self, capakey_rest_gateway): res = capakey_rest_gateway.list_secties_by_afdeling(44021) assert isinstance(res, list) - assert (len(res), 1) + assert len(res) == 1 assert capakey_rest_gateway.caches['long'].get('list_secties_by_afdeling_rest#44021') == res def test_get_sectie_by_id_and_afdeling(self, capakey_rest_gateway): diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index 69dc5a8..262fae8 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -116,19 +116,19 @@ def test_get_provincie_by_id(self): assert res.niscode == 40000 res = self.crab.get_provincie_by_id(50000) assert isinstance(res, Provincie) - assert (res.niscode, 50000) + assert res.niscode == 50000 res = self.crab.get_provincie_by_id(60000) assert isinstance(res, Provincie) - assert (res.niscode, 60000) + assert res.niscode == 60000 res = self.crab.get_provincie_by_id(70000) assert isinstance(res, Provincie) - assert (res.niscode, 70000) + assert res.niscode == 70000 res = self.crab.get_provincie_by_id(80000) assert isinstance(res, Provincie) - assert (res.niscode, 80000) + assert res.niscode == 80000) res = self.crab.get_provincie_by_id(90000) assert isinstance(res, Provincie) - assert (res.niscode, 90000) + assert res.niscode == 90000 def test_get_provincie_by_unexisting_id(self): with pytest.raises(GatewayResourceNotFoundException): @@ -139,17 +139,17 @@ def test_list_gemeenten_by_provincie(self): res = self.crab.list_gemeenten_by_provincie(provincie) assert isinstance(res, list) assert isinstance(res[0], Gemeente) - assert (str(res[0].niscode)[0], '1') + assert str(res[0].niscode)[0] == '1' provincie = 10000 res = self.crab.list_gemeenten_by_provincie(provincie) assert isinstance(res, list) assert isinstance(res[0], Gemeente) - assert (str(res[0].niscode)[0], '1') + assert str(res[0].niscode)[0] == '1' def test_get_gemeente_by_id(self): res = self.crab.get_gemeente_by_id(1) assert isinstance(res, Gemeente) - assert (res.id, 1) + assert res.id == 1 def test_get_gemeente_by_id_with_string(self): with pytest.raises(GatewayRuntimeException): @@ -162,7 +162,7 @@ def test_get_gemeente_by_unexisting_id(self): def test_get_gemeente_by_niscode(self): res = self.crab.get_gemeente_by_niscode(11001) assert isinstance(res, Gemeente) - assert (res.niscode, 11001) + assert res.niscode == 11001 def test_get_gemeente_by_unexisting_niscode(self): with pytest.raises(GatewayResourceNotFoundException): @@ -342,8 +342,8 @@ def test_get_huisnummer_by_unexisting_id(self): def test_get_huisnummer_by_nummer_and_straat(self): res = self.crab.get_huisnummer_by_nummer_and_straat(1, 1) assert isinstance(res, Huisnummer) - assert (res.huisnummer, '1') - assert (res.straat.id, 1) + assert res.huisnummer == '1' + assert res.straat.id == 1 straat = self.crab.get_straat_by_id(1) res = self.crab.get_huisnummer_by_nummer_and_straat(1, straat) assert isinstance(res, Huisnummer) @@ -1060,8 +1060,8 @@ def test_lazy_load(self): def test_str_and_repr_dont_lazy_load(self): s = Straat(1, 'Acacialaan', 1, 3) - assert ('Acacialaan (1)', str(s)) - assert ("Straat(1, 'Acacialaan', 1, 3)", repr(s)) + assert 'Acacialaan (1)' == str(s) + assert "Straat(1, 'Acacialaan', 1, 3)" == repr(s) def test_check_gateway_not_set(self): s = Straat(1, 'Acacialaan', 1, 3) @@ -1319,7 +1319,7 @@ def test_bounding_box(self): h.set_gateway(crab) bounding = h.bounding_box assert isinstance(bounding, list) - assert (len(bounding), 4) + assert len(bounding) == 4 def test_check_gateway_not_set(self): h = Huisnummer(1, 3, '51', 17718) @@ -1531,11 +1531,10 @@ def test_lazy_load(self): ) w = Wegsegment('108724', 4) w.set_gateway(crab) - assert (w.id, "108724") - assert (int(w.status.id), 4) - assert (int(w.methode.id), 3) - assert ( - w.geometrie, + assert w.id == "108724" + assert int(w.status.id) == 4 + assert int(w.methode.id) == 3 + assert w.geometrie == """LINESTRING (150339.255243488 201166.401677653,\ 150342.836939491 201165.832525652,\ 150345.139531493 201165.466573652,\ From 529d612f2fc8d2fbe226a58a7707483f423b7df4 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 14:38:11 +0200 Subject: [PATCH 12/15] Fix tests --- tests/gateway/test_crab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index 262fae8..1bc0b45 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -125,7 +125,7 @@ def test_get_provincie_by_id(self): assert res.niscode == 70000 res = self.crab.get_provincie_by_id(80000) assert isinstance(res, Provincie) - assert res.niscode == 80000) + assert res.niscode == 80000 res = self.crab.get_provincie_by_id(90000) assert isinstance(res, Provincie) assert res.niscode == 90000 From 4bfc43a647ab1a927cbf9b76eb1182613a69f999 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 14:45:04 +0200 Subject: [PATCH 13/15] Fix tests --- tests/gateway/test_crab_cached.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/gateway/test_crab_cached.py b/tests/gateway/test_crab_cached.py index 06a9aee..fd452d3 100644 --- a/tests/gateway/test_crab_cached.py +++ b/tests/gateway/test_crab_cached.py @@ -66,7 +66,7 @@ def test_list_provincies(self): res = self.crab.list_provincies(2) assert isinstance(res, list) assert self.crab.caches['permanent'].get('ListProvinciesByGewestId#2') == res - assert (res[0].gewest.id, 2) + assert res[0].gewest.id == 2 def test_get_provincie_by_id(self): res = self.crab.get_provincie_by_id(10000) @@ -77,14 +77,14 @@ def test_list_gemeenten_default_is_Vlaanderen(self): res = self.crab.list_gemeenten() assert isinstance(res, list) assert self.crab.caches['permanent'].get('ListGemeentenByGewestId#2#1') == res - assert (res[0].gewest.id, 2) + assert res[0].gewest.id == 2 def test_list_gemeenten_gewest_1(self): gewest = Gewest(1) r = self.crab.list_gemeenten(gewest) assert isinstance(r, list) assert self.crab.caches['permanent'].get('ListGemeentenByGewestId#1#1') == r - assert (r[0].gewest.id, 1) + assert r[0].gewest.id == 1 def test_list_gemeenten_different_sort(self): res = self.crab.list_gemeenten(2, 1) From acbc6a5e6970e14a2f7a0593ed17391ce1859bfe Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 14:47:49 +0200 Subject: [PATCH 14/15] Fix tests --- tests/gateway/test_crab.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index 1bc0b45..a3ee97f 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -1534,8 +1534,7 @@ def test_lazy_load(self): assert w.id == "108724" assert int(w.status.id) == 4 assert int(w.methode.id) == 3 - assert w.geometrie == - """LINESTRING (150339.255243488 201166.401677653,\ + assert w.geometrie == """LINESTRING (150339.255243488 201166.401677653,\ 150342.836939491 201165.832525652,\ 150345.139531493 201165.466573652,\ 150349.791371495 201164.769421652,\ From 80d3490992be1b35da68dffdaaabdfc88b2869f7 Mon Sep 17 00:00:00 2001 From: Koen Van Daele Date: Thu, 21 Sep 2017 14:50:56 +0200 Subject: [PATCH 15/15] Fix tests --- tests/gateway/test_crab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/gateway/test_crab.py b/tests/gateway/test_crab.py index a3ee97f..0501851 100644 --- a/tests/gateway/test_crab.py +++ b/tests/gateway/test_crab.py @@ -1556,7 +1556,7 @@ def test_lazy_load(self): 150543.214411631 200773.35943738,\ 150546.079307631 200764.489805374,\ 150548.592075631 200754.511565369)""" - ) + w.metadata.set_gateway(crab) assert isinstance(w.metadata, Metadata) assert not w.metadata.begin_datum == None