예제 #1
0
 def test_promo_inexistente(self):
     msisdn = '56999694443'
     r = Response(msisdn)
     expected_response = \
         build_response_message(
             msisdn, self.RSLT_ERR_PROMO_INEXISTENTE
         )
     assert expected_response == r.build()
예제 #2
0
def handle_connection(connection, message):
    msisdn = Parser(message).msisdn()
    response = str(Response(msisdn.text).build())

    if response != 'no response':
        connection.sendall(response)
    conn.close()
예제 #3
0
 def test_tipo_cliente_dst(self):
     msisdn = '56999694410'
     r = Response(msisdn)
     assert build_response_message(
         msisdn, self.RSLT_ERR_TIPO_CLIENTE_DST) == r.build()
예제 #4
0
 def test_sin_saldo(self):
     msisdn = '56999694414'
     r = Response(msisdn)
     assert build_response_message(msisdn,
                                   self.RSLT_ERR_SIN_SALDO_PP) == r.build()
예제 #5
0
 def test_exito(self):
     msisdn = '56999694444'
     r = Response(msisdn)
     assert build_response_message(msisdn, self.RSLT_EXITO) == r.build()
예제 #6
0
 def test_no_response(self):
     msisdn = '56999694425'
     r = Response(msisdn)
     assert self.NO_RESPONSE == r.build()
예제 #7
0
 def test_not_known_msisdn(self):
     msisdn = '12'
     r = Response(msisdn)
     assert self.NO_RESPONSE == r.build()