# coding: utf-8

"""
    Airflow API

    Airflow API. All endpoints located under ``/api/v2`` can be used safely, are stable and backward compatible. Endpoints located under ``/ui`` are dedicated to the UI and are subject to breaking change depending on the need of the frontend. Users should not rely on those but use the public ones instead.

    The version of the OpenAPI document: 2
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


import unittest

from airflow_client.client.models.pool_patch_body import PoolPatchBody

class TestPoolPatchBody(unittest.TestCase):
    """PoolPatchBody unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional) -> PoolPatchBody:
        """Test PoolPatchBody
            include_optional is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # uncomment below to create an instance of `PoolPatchBody`
        """
        model = PoolPatchBody()
        if include_optional:
            return PoolPatchBody(
                description = '',
                include_deferred = True,
                pool = '',
                slots = 56
            )
        else:
            return PoolPatchBody(
        )
        """

    def testPoolPatchBody(self):
        """Test PoolPatchBody"""
        # inst_req_only = self.make_instance(include_optional=False)
        # inst_req_and_optional = self.make_instance(include_optional=True)

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