Example #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())
Example #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")
Example #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
Example #4
0
 def test_result_is_dict(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertIsInstance(result, dict)
Example #5
0
 def test_subscriber_number_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['subscriber_number'], "76123456")
Example #6
0
 def test_subscriber_number(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['subscriber_number'], "76123456")
Example #7
0
 def test_mno_identifier_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['mno_identifier'], "VIP Operator")
Example #8
0
 def test_mno_identifier(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['mno_identifier'], "VIP Operator")
Example #9
0
 def test_country_identifier_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_identifier'], "MK")
Example #10
0
 def test_country_identifier(self):
     msisdn = "38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_identifier'], "MK")
Example #11
0
 def test_country_dialing_code_with_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertEqual(result['country_dialing_code'], "389")
Example #12
0
 def test_leading_plus(self):
     msisdn = "+38976123456"
     result = Parser.transform(msisdn)
     self.assertIsInstance(result, dict)