# Path: paystackapi/tests/base_test_case.py
# class BaseTestCase(unittest.TestCase):
# 		
# 	def endpoint_url(self, path):
# 		if path[0] == '/':
# 			return 'https://api.paystack.co{}'.format(path)
# 		return 'https://api.paystack.co/{}'.format(path)
# 
# Path: paystackapi/trecipient.py
# class TransferRecipient(PayStackBase):
#     """docstring for Transfer Recipient."""
# 
#     @classmethod
#     def create(cls, **kwargs):
#         """
#         Method defined to create transfer recipient.
# 
#         Args:
#             type: Recipient Type (Only nuban at this time)
#             name: A name for the recipient
#             account_number: Required if type is nuban
#             bank_code: Required if type is nuban. 
#                        You can get the list of Bank Codes by calling the List Banks endpoint.
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transferrecipient', data=kwargs,)
#     
#     @classmethod
#     def list(cls, **kwargs):
#         """
#         Method defined to list transfer recipient.
# 
#         Args:
#             perPage: records you want to retrieve per page (Integer)
#             page: what page you want to retrieve (Integer)
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transferrecipient', qs=kwargs,)


import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.trecipient import TransferRecipient
    def test_create_trecipient(self):
        """Method defined to test trecipient creation."""
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transferrecipient"),
            content_type='text/json',
            body='{"status": true, "message": "Recipient created"}',
            status=201,
        )

        response = TransferRecipient.create(
            type="nuban",
            name="Zombie",
            description="Zombier",
            account_number="01000000010",
            bank_code="044",
        )
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_list_trecipient(self):
        """Method defined to test trecipient list."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/transferrecipient"),
            content_type='text/json',
            body='{"status": true, "message": "Recipient retrieved"}',
            status=201,
        )


# Path: paystackapi/tests/base_test_case.py
# class BaseTestCase(unittest.TestCase):
# 		
# 	def endpoint_url(self, path):
# 		if path[0] == '/':
# 			return 'https://api.paystack.co{}'.format(path)
# 		return 'https://api.paystack.co/{}'.format(path)
# 
# Path: paystackapi/trecipient.py
# class TransferRecipient(PayStackBase):
#     """docstring for Transfer Recipient."""
# 
#     @classmethod
#     def create(cls, **kwargs):
#         """
#         Method defined to create transfer recipient.
# 
#         Args:
#             type: Recipient Type (Only nuban at this time)
#             name: A name for the recipient
#             account_number: Required if type is nuban
#             bank_code: Required if type is nuban. 
#                        You can get the list of Bank Codes by calling the List Banks endpoint.
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('transferrecipient', data=kwargs,)
#     
#     @classmethod
#     def list(cls, **kwargs):
#         """
#         Method defined to list transfer recipient.
# 
#         Args:
#             perPage: records you want to retrieve per page (Integer)
#             page: what page you want to retrieve (Integer)
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('transferrecipient', qs=kwargs,)


# Path: paystackapi/tests/test_trecipient.py
import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.trecipient import TransferRecipient

    def test_create_trecipient(self):
        """Method defined to test trecipient creation."""
        httpretty.register_uri(
            httpretty.POST,
            self.endpoint_url("/transferrecipient"),
            content_type='text/json',
            body='{"status": true, "message": "Recipient created"}',
            status=201,
        )

        response = TransferRecipient.create(
            type="nuban",
            name="Zombie",
            description="Zombier",
            account_number="01000000010",
            bank_code="044",
        )
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_list_trecipient(self):
        """Method defined to test trecipient list."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/transferrecipient"),
            content_type='text/json',
            body='{"status": true, "message": "Recipient retrieved"}',
            status=201,
        )


        response = TransferRecipient.list(perPage=3, page=1)