X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a8bedb6ab9ae22ba88f2a85afc7a9021aae283ff..261e0cfd5a084dc5de333eda1093a9e7635c4859:/test/bdd/steps/check_functions.py diff --git a/test/bdd/steps/check_functions.py b/test/bdd/steps/check_functions.py index 58d6c1f2..49676896 100644 --- a/test/bdd/steps/check_functions.py +++ b/test/bdd/steps/check_functions.py @@ -47,15 +47,16 @@ class Field: """ Generic comparator for fields, which looks at the type of the value compared. """ - def __init__(self, value): + def __init__(self, value, **extra_args): self.value = value + self.extra_args = extra_args def __eq__(self, other): if isinstance(self.value, float): - return math.isclose(self.value, float(other)) + return math.isclose(self.value, float(other), **self.extra_args) if self.value.startswith('^'): - return re.fullmatch(self.value, other) + return re.fullmatch(self.value, str(other)) if isinstance(other, dict): return other == eval('{' + self.value + '}')