From 8dd9d823f32be677ecb4caf774910102baef4fe7 Mon Sep 17 00:00:00 2001 From: David Drysdale Date: Tue, 18 Apr 2023 16:25:23 +0100 Subject: [PATCH] Tests for CountryCodeSource.to_string --- python/tests/phonenumberutiltest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/tests/phonenumberutiltest.py b/python/tests/phonenumberutiltest.py index 00a2c072b..c6a3ac705 100755 --- a/python/tests/phonenumberutiltest.py +++ b/python/tests/phonenumberutiltest.py @@ -3325,6 +3325,12 @@ def testEnumString(self): self.assertEqual(ValidationResult.to_string(ValidationResult.TOO_LONG), u("TOO_LONG")) self.assertEqual(ValidationResult.to_string(999), u("INVALID (999)")) + self.assertEqual(CountryCodeSource.to_string(CountryCodeSource.UNSPECIFIED), u("UNSPECIFIED")) + self.assertEqual(CountryCodeSource.to_string(CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN), u("FROM_NUMBER_WITH_PLUS_SIGN")) + self.assertEqual(CountryCodeSource.to_string(CountryCodeSource.FROM_NUMBER_WITH_IDD), u("FROM_NUMBER_WITH_IDD")) + self.assertEqual(CountryCodeSource.to_string(CountryCodeSource.FROM_DEFAULT_COUNTRY), u("FROM_DEFAULT_COUNTRY")) + self.assertEqual(CountryCodeSource.to_string(999), u("INVALID (999)")) + def testCoverage(self): # Python version extra tests self.assertIsNone(phonenumberutil._region_code_for_number_from_list(GB_NUMBER, ("XX",)))