예제 #1
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_fallback_capitalization(self):
     with pytest.raises(ValueError):
         assert normalize_phone_number('1234', 'de') == '+491234'
예제 #2
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_fallback_differs(self):
     assert normalize_phone_number('+10 1234', 'DE') == '+101234'  # DE = +49
예제 #3
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_fallback(self):
     assert normalize_phone_number('1234', 'DE') == '+491234'
예제 #4
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_outgoing_international(self, input, fallback_cc, output):
     assert normalize_phone_number(input, fallback_cc) == output
예제 #5
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_outgoing_international_no_fallback(self):
     with pytest.raises(ValueError):
         normalize_phone_number('0010 1234', None)
예제 #6
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_no_fallback_failing(self):
     with pytest.raises(ValueError):
         normalize_phone_number('1234 / 5678', None)  # No CC, no fallback
예제 #7
0
파일: utils.py 프로젝트: audax/qabel-index
 def test_no_fallback(self):
     number = normalize_phone_number('+49 1234-5678', None)
     assert number == '+4912345678'
예제 #8
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_fallback(self):
     assert normalize_phone_number("1234", "DE") == "+491234"
예제 #9
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_fallback_capitalization(self):
     with pytest.raises(ValueError):
         assert normalize_phone_number("1234", "de") == "+491234"
예제 #10
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_fallback_differs(self):
     assert normalize_phone_number("+10 1234", "DE") == "+101234"  # DE = +49
예제 #11
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_outgoing_international_no_fallback(self):
     with pytest.raises(ValueError):
         normalize_phone_number("0010 1234", None)
예제 #12
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_outgoing_international(self, input, fallback_cc, output):
     assert normalize_phone_number(input, fallback_cc) == output
예제 #13
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_no_fallback(self):
     number = normalize_phone_number("+49 1234-5678", None)
     assert number == "+4912345678"
예제 #14
0
파일: utils.py 프로젝트: Qabel/qabel-index
 def test_no_fallback_failing(self):
     with pytest.raises(ValueError):
         normalize_phone_number("1234 / 5678", None)  # No CC, no fallback