def test_notification(send_op_result, phone_number, amount, expected_message, expected_notification): request_id = 'request-id' topup(request_id, 'topup_att', phone_number, amount, 'MXN') assert send_op_result.called op_info = send_op_result.call_args[0][0] assert op_info.notification == expected_notification
def test_topup_with_non_min_value(send_op_result): request_id = 'request-id' topup(request_id, 'topup_att', '501000000007', 1) assert send_op_result.called op_info = send_op_result.call_args[0][0] assert op_info.request_id == request_id assert op_info.tran_type == OperationType.topup assert op_info.status == OperationStatus.failed assert op_info.notification == 'El monto a pagar es inválido.'
def test_failed_topup(send_op_result, phone_number, amount, expected_message): request_id = 'request-id' topup(request_id, 'topup_att', phone_number, amount, 'MXN') assert send_op_result.called op_info = send_op_result.call_args[0][0] assert op_info.request_id == request_id assert op_info.tran_type == OperationType.topup assert op_info.status == OperationStatus.failed assert op_info.error_message == expected_message
def test_successful_topup(send_op_result): request_id = 'request-id' topup(request_id, 'topup_att', '5599999999', 10000, 'MXN') assert send_op_result.called op_info = send_op_result.call_args[0][0] assert op_info.request_id == request_id assert op_info.tran_type == OperationType.topup assert op_info.status == OperationStatus.success assert op_info.operation.amount == 10000 assert op_info.operation.currency == 'MXN' assert (op_info.operation.starting_balance > op_info.operation.ending_balance)
def test_successful_invoice_with_name_on_account(send_op_result): request_id = 'request-id' topup(request_id, 'internet_axtel', '5599999999', 35000, 'MXN', 'Billy R. Rosemond') assert send_op_result.called op_info = send_op_result.call_args[0][0] assert op_info.request_id == request_id assert op_info.tran_type == OperationType.topup assert op_info.status == OperationStatus.success assert op_info.operation.amount == 35000 assert op_info.operation.currency == 'MXN' assert (op_info.operation.starting_balance > op_info.operation.ending_balance)