Beispiel #1
0
 def test_check_keys(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertIn('mno_identifier', result.keys())
     self.assertIn('country_dialing_code', result.keys())
     self.assertIn('subscriber_number', result.keys())
     self.assertIn('country_identifier', result.keys())
Beispiel #2
0
 def test_slovenian_number(self):
     msisdn = "+38640658494"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_identifier'], "SI")
     self.assertEqual(result['country_dialing_code'], "386")
     self.assertEqual(result['mno_identifier'], "Si.mobil")
     self.assertEqual(result['subscriber_number'], "40658494")
Beispiel #3
0
 def transform(self, msisdn):
     try:
         result = Parser.transform(msisdn)
         self.logger.debug(result)
         return result
     except Exception as e:
         self.logger.debug(e.message)
         return e.message
Beispiel #4
0
 def test_result_is_dict(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertIsInstance(result, dict)
Beispiel #5
0
 def test_subscriber_number_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['subscriber_number'], "76123456")
Beispiel #6
0
 def test_subscriber_number(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['subscriber_number'], "76123456")
Beispiel #7
0
 def test_mno_identifier_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['mno_identifier'], "VIP Operator")
Beispiel #8
0
 def test_mno_identifier(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['mno_identifier'], "VIP Operator")
Beispiel #9
0
 def test_country_identifier_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_identifier'], "MK")
Beispiel #10
0
 def test_country_identifier(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_identifier'], "MK")
Beispiel #11
0
 def test_country_dialing_code_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_dialing_code'], "389")
Beispiel #12
0
 def test_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertIsInstance(result, dict)