mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Remove obsolete strip_leading_plus_one method
This commit is contained in:
@@ -134,11 +134,3 @@ def fetch_potential_service(inbound_number, provider_name):
|
|||||||
def has_inbound_sms_permissions(permissions):
|
def has_inbound_sms_permissions(permissions):
|
||||||
str_permissions = [p.permission for p in permissions]
|
str_permissions = [p.permission for p in permissions]
|
||||||
return set([INBOUND_SMS_TYPE, SMS_TYPE]).issubset(set(str_permissions))
|
return set([INBOUND_SMS_TYPE, SMS_TYPE]).issubset(set(str_permissions))
|
||||||
|
|
||||||
|
|
||||||
def strip_leading_plus_one(number):
|
|
||||||
if number.startswith('+'):
|
|
||||||
number = number.replace('+', '', 1)
|
|
||||||
if number.startswith('1'):
|
|
||||||
number = number.replace('1', '', 1)
|
|
||||||
return number
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ from app.models import EMAIL_TYPE, INBOUND_SMS_TYPE, SMS_TYPE, InboundSms
|
|||||||
from app.notifications.receive_notifications import (
|
from app.notifications.receive_notifications import (
|
||||||
create_inbound_sms_object,
|
create_inbound_sms_object,
|
||||||
has_inbound_sms_permissions,
|
has_inbound_sms_permissions,
|
||||||
strip_leading_plus_one,
|
|
||||||
unescape_string,
|
unescape_string,
|
||||||
)
|
)
|
||||||
from tests.app.db import (
|
from tests.app.db import (
|
||||||
@@ -238,19 +237,6 @@ def test_receive_notification_error_if_not_single_matching_service(client, notif
|
|||||||
assert InboundSms.query.count() == 0
|
assert InboundSms.query.count() == 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
|
||||||
'number, expected',
|
|
||||||
[
|
|
||||||
('12028675309', '2028675309'),
|
|
||||||
('+12028675309', '2028675309'),
|
|
||||||
('2028675309', '2028675309'),
|
|
||||||
('15111111111', '5111111111')
|
|
||||||
]
|
|
||||||
)
|
|
||||||
def test_strip_leading_country_code(number, expected):
|
|
||||||
assert strip_leading_plus_one(number) == expected
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skip(reason="Need to implement inbound SNS tests. Body here from MMG")
|
@pytest.mark.skip(reason="Need to implement inbound SNS tests. Body here from MMG")
|
||||||
@pytest.mark.parametrize("auth, keys, status_code", [
|
@pytest.mark.parametrize("auth, keys, status_code", [
|
||||||
["testkey", ["testkey"], 200],
|
["testkey", ["testkey"], 200],
|
||||||
|
|||||||
Reference in New Issue
Block a user