# coding: utf-8

"""
    Conekta API

    Conekta sdk  # noqa: E501

    The version of the OpenAPI document: 2.1.0
    Contact: engineering@conekta.com
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest

import conekta
from conekta import ApiClient
from conekta.api.payment_methods_api import PaymentMethodsApi  # noqa: E501
from conekta.rest import ApiException
from test.test_utils import get_base_path


class TestPaymentMethodsApi(unittest.TestCase):
    """PaymentMethodsApi unit test stubs"""

    def setUp(self):
        self.api = conekta.api.payment_methods_api.PaymentMethodsApi(ApiClient(
            configuration=conekta.Configuration(host=get_base_path())
        ))  # noqa: E501

    def tearDown(self):
        pass

    def test_create_customer_payment_methods(self):
        """Test case for create_customer_payment_methods

        Create Payment Method  # noqa: E501
        """
        accept_language = 'es'
        rq = conekta.CreateCustomerPaymentMethodsRequest(
            conekta.PaymentMethodCashRequest(
                type='oxxo_recurrent'
            )
        )
            
        response = self.api.create_customer_payment_methods('cus_2tXyF9BwPG14UMkkg', rq, accept_language)
        self.assertIsNotNone(response)
        self.assertIsInstance(response.actual_instance, conekta.PaymentMethodCashResponse)
        self.assertEqual('oxxo_recurrent', response.actual_instance.type)

    def test_delete_customer_payment_methods(self):
        """Test case for delete_customer_payment_methods

        Delete Payment Method  # noqa: E501
        """
        accept_language = 'es'
        response = self.api.delete_customer_payment_methods('cus_2tYENskzTjjgkGQLt', 'src_2tbd5Bgy67RL9oycM',
                                                            accept_language)
        self.assertIsNotNone(response)

    def test_get_customer_payment_methods(self):
        """Test case for get_customer_payment_methods

        Get Payment Methods  # noqa: E501
        """
        accept_language = 'es'
        response = self.api.get_customer_payment_methods('cus_2tYENskzTjjgkGQLt', accept_language)
        self.assertIsNotNone(response)
        self.assertIsNotNone(response.data)
        self.assertIsInstance(response.data[0].actual_instance, conekta.PaymentMethodCardResponse)
        self.assertEqual('card', response.data[0].actual_instance.type)

    def test_update_customer_payment_methods(self):
        """Test case for update_customer_payment_methods

        Update Payment Method  # noqa: E501
        """
        accept_language = 'es'
        rq = conekta.UpdatePaymentMethods(
            name='test'
        )
        response = self.api.update_customer_payment_methods('cus_2tYENskzTjjgkGQLt', 'src_2tbd5Bgy67RL9oycM', rq,
                                                            accept_language)
        self.assertIsNotNone(response)


if __name__ == '__main__':
    unittest.main()
