]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/bdd/steps/check_functions.py
enable flake for bdd test code
[nominatim.git] / test / bdd / steps / check_functions.py
index 708de852c03a5720d5a656a3c0d372911bdbb0a0..df9e6f35ec362957d22c1f910b18abd16918837e 100644 (file)
@@ -2,7 +2,7 @@
 #
 # This file is part of Nominatim. (https://nominatim.org)
 #
-# Copyright (C) 2023 by the Nominatim developer community.
+# Copyright (C) 2025 by the Nominatim developer community.
 # For a full list of authors see the git log.
 """
 Collection of assertion functions used for the steps.
@@ -11,9 +11,10 @@ import json
 import math
 import re
 
-OSM_TYPE = {'N' : 'node', 'W' : 'way', 'R' : 'relation',
-            'n' : 'node', 'w' : 'way', 'r' : 'relation',
-            'node' : 'n', 'way' : 'w', 'relation' : 'r'}
+
+OSM_TYPE = {'N': 'node', 'W': 'way', 'R': 'relation',
+            'n': 'node', 'w': 'way', 'r': 'relation',
+            'node': 'n', 'way': 'w', 'relation': 'r'}
 
 
 class OsmType:
@@ -23,11 +24,9 @@ class OsmType:
     def __init__(self, value):
         self.value = value
 
-
     def __eq__(self, other):
         return other == self.value or other == OSM_TYPE[self.value]
 
-
     def __str__(self):
         return f"{self.value} or {OSM_TYPE[self.value]}"
 
@@ -81,7 +80,6 @@ class Bbox:
         return str(self.coord)
 
 
-
 def check_for_attributes(obj, attrs, presence='present'):
     """ Check that the object has the given attributes. 'attrs' is a
         string with a comma-separated list of attributes. If 'presence'
@@ -99,4 +97,3 @@ def check_for_attributes(obj, attrs, presence='present'):
         else:
             assert attr in obj, \
                    f"No attribute '{attr}'. Full response:\n{_dump_json()}"
-