Skip to content

Commit 93a75fb

Browse files
committed
SDK-1196: Correct mispelling of longitude in Python SDK
1 parent a6d5a2e commit 93a75fb

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

yoti_python_sdk/dynamic_sharing_service/extension/location_constraint_extension_builder.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# -*- coding: utf-8 -*-
22
from __future__ import unicode_literals
33

4+
from deprecated import deprecated
5+
46

57
class LocationConstraintExtensionBuilder(object):
68
LOCATION_CONSTRAINT = "LOCATION_CONSTRAINT"
@@ -11,7 +13,7 @@ def __init__(self):
1113
self.__extension["content"] = {}
1214
self.__device_location = {
1315
"latitude": None,
14-
"longtitude": None,
16+
"longitude": None,
1517
"radius": None,
1618
"max_uncertainty_radius": None,
1719
}
@@ -21,8 +23,16 @@ def with_latitude(self, latitude):
2123
self.__device_location["latitude"] = latitude
2224
return self
2325

26+
@deprecated
2427
def with_longtitude(self, longtitude):
25-
self.__device_location["longtitude"] = longtitude
28+
"""
29+
To be removed in v3.0.0
30+
Use with_longitude instead
31+
"""
32+
return self.with_longitude(longtitude)
33+
34+
def with_longitude(self, longitude):
35+
self.__device_location["longitude"] = longitude
2636
return self
2737

2838
def with_radius(self, radius):

yoti_python_sdk/tests/dynamic_sharing_service/extension/test_location_constraint_extension_builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
def test_builds_with_given_values():
1010
LATITUDE = 50
11-
LONGTITUDE = 99
11+
LONGITUDE = 99
1212
RADIUS = 60
1313
UNCERTAINTY = 30
1414

1515
extension = (
1616
LocationConstraintExtensionBuilder()
1717
.with_latitude(LATITUDE)
18-
.with_longtitude(LONGTITUDE)
18+
.with_longitude(LONGITUDE)
1919
.with_radius(RADIUS)
2020
.with_uncertainty(UNCERTAINTY)
2121
.build()
@@ -24,6 +24,6 @@ def test_builds_with_given_values():
2424
device_location = extension["content"]["expected_device_location"]
2525

2626
assert device_location["latitude"] == LATITUDE
27-
assert device_location["longtitude"] == LONGTITUDE
27+
assert device_location["longitude"] == LONGITUDE
2828
assert device_location["radius"] == RADIUS
2929
assert device_location["max_uncertainty_radius"] == UNCERTAINTY

0 commit comments

Comments
 (0)