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