[openaddresses] making a few methods classmethods so they're easier to test
This commit is contained in:
@@ -163,7 +163,8 @@ class OpenAddressesFormatter(object):
|
|||||||
|
|
||||||
return country_name
|
return country_name
|
||||||
|
|
||||||
def cleanup_number(self, num):
|
@classmethod
|
||||||
|
def cleanup_number(cls, num):
|
||||||
num = num.strip()
|
num = num.strip()
|
||||||
try:
|
try:
|
||||||
num_int = int(num)
|
num_int = int(num)
|
||||||
@@ -183,7 +184,8 @@ class OpenAddressesFormatter(object):
|
|||||||
pass
|
pass
|
||||||
return num
|
return num
|
||||||
|
|
||||||
def spanish_street_name(self, street):
|
@classmethod
|
||||||
|
def spanish_street_name(cls, street):
|
||||||
'''
|
'''
|
||||||
Most Spanish street names begin with Calle officially
|
Most Spanish street names begin with Calle officially
|
||||||
but since it's so common, this is often omitted entirely.
|
but since it's so common, this is often omitted entirely.
|
||||||
@@ -201,7 +203,8 @@ class OpenAddressesFormatter(object):
|
|||||||
return street
|
return street
|
||||||
|
|
||||||
# HACK: remove method when #1932 is resolved in OpenAddresses
|
# HACK: remove method when #1932 is resolved in OpenAddresses
|
||||||
def dutch_house_number(self, house_number):
|
@classmethod
|
||||||
|
def dutch_house_number(cls, house_number):
|
||||||
house_number = safe_decode(house_number)
|
house_number = safe_decode(house_number)
|
||||||
match = dutch_house_number_regex.match(house_number)
|
match = dutch_house_number_regex.match(house_number)
|
||||||
if not match:
|
if not match:
|
||||||
|
|||||||
Reference in New Issue
Block a user