# 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/cpanel.py
# class ControlPanel(PayStackBase):
#     """docstring for ControlPanel."""
# 
#     @classmethod
#     def fetch_payment_session_timeout(cls):
#         """
#         Method defined to fetch payment session timeout.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('integration/payment_session_timeout')
#     
#     @classmethod
#     def update_payment_session_timeout(cls, **kwargs):
#         """
#         Method defined to update payment session timeout.
# 
#         Args:
#             timeout: Time before stopping session (in seconds). 
#                      Set to 0 to cancel session timeouts
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.put('integration/payment_session_timeout', data=kwargs,)


import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.cpanel import ControlPanel



class TestPage(BaseTestCase):

    @httpretty.activate
    def test_fetch_payment_session_timeout(self):
        """Method defined to test fetch payment session timeout."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/integration/payment_session_timeout"),
            content_type='text/json',
            body='{"status": true, "message": "Payment session timeout retrieved"}',
            status=201,
        )

        response = ControlPanel.fetch_payment_session_timeout()
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_update_payment_session_timeout(self):
        """Method defined to test update payment session timeout."""
        httpretty.register_uri(
            httpretty.PUT,
            self.endpoint_url("/integration/payment_session_timeout"),
            content_type='text/json',
            body='{"status": true, "message": "Payment session timeout updated"}',
            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/cpanel.py
# class ControlPanel(PayStackBase):
#     """docstring for ControlPanel."""
# 
#     @classmethod
#     def fetch_payment_session_timeout(cls):
#         """
#         Method defined to fetch payment session timeout.
# 
#         Args:
#             No argument required.
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.get('integration/payment_session_timeout')
#     
#     @classmethod
#     def update_payment_session_timeout(cls, **kwargs):
#         """
#         Method defined to update payment session timeout.
# 
#         Args:
#             timeout: Time before stopping session (in seconds). 
#                      Set to 0 to cancel session timeouts
# 
#         Returns:
#             Json data from paystack API.
#         """
#         return cls().requests.put('integration/payment_session_timeout', data=kwargs,)


# Path: paystackapi/tests/test_cpanel.py
import httpretty
from paystackapi.tests.base_test_case import BaseTestCase
from paystackapi.cpanel import ControlPanel




class TestPage(BaseTestCase):

    @httpretty.activate
    def test_fetch_payment_session_timeout(self):
        """Method defined to test fetch payment session timeout."""
        httpretty.register_uri(
            httpretty.GET,
            self.endpoint_url("/integration/payment_session_timeout"),
            content_type='text/json',
            body='{"status": true, "message": "Payment session timeout retrieved"}',
            status=201,
        )

        response = ControlPanel.fetch_payment_session_timeout()
        self.assertTrue(response['status'])

    @httpretty.activate
    def test_update_payment_session_timeout(self):
        """Method defined to test update payment session timeout."""
        httpretty.register_uri(
            httpretty.PUT,
            self.endpoint_url("/integration/payment_session_timeout"),
            content_type='text/json',
            body='{"status": true, "message": "Payment session timeout updated"}',
            status=201,
        )


        response = ControlPanel.update_payment_session_timeout(timeout=30)