# 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/subaccount.py
# class SubAccount(PayStackBase):
#     """docstring for SubAccount."""
# 
#     @classmethod
#     def create(cls, **kwargs):
#         """
#         Function defined to create subaccount.
# 
#         Args:
#             business_name: name of business for subaccount
#             settlement_bank: name of Bank (accepted banks)
#             account_number: NUBAN Bank Account number
#             percentage_charge: default percentage charged on subaccount?
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('subaccount', data=kwargs,)
# 
#     @classmethod
#     def list(cls, **kwargs):
#         """
#         List subaccounts
#         
#         Args:
#             perPage: records you want to retrieve per page (Integer)
#             page: what page you want to retrieve (Integer)
#         
#         Returns:
#         JSON data from paystack's API.
#         """
#         return cls().requests.get("subaccount", qs=kwargs,)
# 
#     @classmethod
#     def fetch(cls, id_or_slug):
#         """
#         Get a single subaccount by id or slug.
# 
#         Args:
#             id_or_slug: id or subaccount_code
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"subaccount/{id_or_slug}")
# 
#     @classmethod
#     def update(cls, id_or_slug, **kwargs):
#         """
#         Update a single subaccount by id or slug.
# 
#         Args:
#             id_or_slug: id or subaccount_code
#             business_name: name of business for subaccount
#             settlement_bank: name of Bank (accepted banks)
#             account_number: NUBAN Bank Account number
#             percentage_charge: default percentage charged on subaccount?
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.put(f"subaccount/{id_or_slug}", data=kwargs,)


import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.subaccount import SubAccount
            business_name="Test Biz 123", settlement_bank="Access Bank",
            account_number="xxxxxxxxx", percentage_charge="6.9"
        )
        self.assertTrue(response['status'])

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

        response = SubAccount.list(perPage=3, page=1)
        self.assertEqual(response['status'], True)
    
    @httpretty.activate
    def test_subaccount_fetch(self):
        """Method defined to test subaccount fetch."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/subaccount/ACCT_4hl4xenwpjy5wb"),
            content_type='text/json',
            body='{"status": true, "message": "Subaccount 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/subaccount.py
# class SubAccount(PayStackBase):
#     """docstring for SubAccount."""
# 
#     @classmethod
#     def create(cls, **kwargs):
#         """
#         Function defined to create subaccount.
# 
#         Args:
#             business_name: name of business for subaccount
#             settlement_bank: name of Bank (accepted banks)
#             account_number: NUBAN Bank Account number
#             percentage_charge: default percentage charged on subaccount?
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.post('subaccount', data=kwargs,)
# 
#     @classmethod
#     def list(cls, **kwargs):
#         """
#         List subaccounts
#         
#         Args:
#             perPage: records you want to retrieve per page (Integer)
#             page: what page you want to retrieve (Integer)
#         
#         Returns:
#         JSON data from paystack's API.
#         """
#         return cls().requests.get("subaccount", qs=kwargs,)
# 
#     @classmethod
#     def fetch(cls, id_or_slug):
#         """
#         Get a single subaccount by id or slug.
# 
#         Args:
#             id_or_slug: id or subaccount_code
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get(f"subaccount/{id_or_slug}")
# 
#     @classmethod
#     def update(cls, id_or_slug, **kwargs):
#         """
#         Update a single subaccount by id or slug.
# 
#         Args:
#             id_or_slug: id or subaccount_code
#             business_name: name of business for subaccount
#             settlement_bank: name of Bank (accepted banks)
#             account_number: NUBAN Bank Account number
#             percentage_charge: default percentage charged on subaccount?
#             **kwargs
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.put(f"subaccount/{id_or_slug}", data=kwargs,)


# Path: paystackapi/tests/test_subaccount.py
import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.subaccount import SubAccount

            business_name="Test Biz 123", settlement_bank="Access Bank",
            account_number="xxxxxxxxx", percentage_charge="6.9"
        )
        self.assertTrue(response['status'])

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

        response = SubAccount.list(perPage=3, page=1)
        self.assertEqual(response['status'], True)
    
    @httpretty.activate
    def test_subaccount_fetch(self):
        """Method defined to test subaccount fetch."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/subaccount/ACCT_4hl4xenwpjy5wb"),
            content_type='text/json',
            body='{"status": true, "message": "Subaccount retrieved"}',
            status=201,
        )


        response = SubAccount.fetch(id_or_slug="ACCT_4hl4xenwpjy5wb")