import unittest
from swagger_codegen.models.employee import Employee
from swagger_codegen.models.contact import Contact
from parameterized import parameterized, param


class TestEmployee(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @parameterized.expand([
        param(
            "all",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=Employee(
                "0001",
                "employee_name1",
                Contact(
                    "09012345678",
                    "address1"
                )
            )),
        param(
            "no contact",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                # "contact": {
                #     "phone": "09012345678",
                #     "address": "address1"
                # }
            },
            expected=Employee(
                "0001",
                "employee_name1"
            )),
    ])
    def test_from_dict(self, _, input, expected):
        employee = Employee.from_dict(input)

        self.assertEqual(employee, expected)

    @parameterized.expand([
        param(
            "no error",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[]),
        param(
            "required employee_name",
            input={
                # "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[
                {
                    "code": "required",
                    "field": "employee_id",
                    "message": "Invalid value for `employee_id`, must not be `None`"
                }
            ]),
        param(
            "required contact",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                # "contact": {
                #     "phone": "09012345678",
                #     "address": "address1"
                # }
            },
            expected=[
                {
                    "code": "required",
                    "field": "contact",
                    "message": "Invalid value for `contact`, must not be `None`"
                }
            ]),
        param(
            "required phone",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    # "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[
                {
                    "code": "required",
                    "field": "contact.phone",
                    "message": "Invalid value for `phone`, must not be `None`"
                }
            ]),
    ])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()

        self.assertEqual(errors, expected)


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

b58873a23c653170f5ff3ec4aa9793f543e1c839
<mask token>


class TestEmployee(unittest.TestCase):
    <mask token>

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass
    <mask token>

    @parameterized.expand([param('no error', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=[]), param(
        'required employee_name', input={'employee_name': 'employee_name1',
        'contact': {'phone': '09012345678', 'address': 'address1'}},
        expected=[{'code': 'required', 'field': 'employee_id', 'message':
        'Invalid value for `employee_id`, must not be `None`'}]), param(
        'required contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=[{'code': 'required', 'field':
        'contact', 'message':
        'Invalid value for `contact`, must not be `None`'}]), param(
        'required phone', input={'employee_id': '0001', 'employee_name':
        'employee_name1', 'contact': {'address': 'address1'}}, expected=[{
        'code': 'required', 'field': 'contact.phone', 'message':
        'Invalid value for `phone`, must not be `None`'}])])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()
        self.assertEqual(errors, expected)


<mask token>

<mask token>


class TestEmployee(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass
    <mask token>

    @parameterized.expand([param('no error', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=[]), param(
        'required employee_name', input={'employee_name': 'employee_name1',
        'contact': {'phone': '09012345678', 'address': 'address1'}},
        expected=[{'code': 'required', 'field': 'employee_id', 'message':
        'Invalid value for `employee_id`, must not be `None`'}]), param(
        'required contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=[{'code': 'required', 'field':
        'contact', 'message':
        'Invalid value for `contact`, must not be `None`'}]), param(
        'required phone', input={'employee_id': '0001', 'employee_name':
        'employee_name1', 'contact': {'address': 'address1'}}, expected=[{
        'code': 'required', 'field': 'contact.phone', 'message':
        'Invalid value for `phone`, must not be `None`'}])])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()
        self.assertEqual(errors, expected)


<mask token>

<mask token>


class TestEmployee(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @parameterized.expand([param('all', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=Employee('0001',
        'employee_name1', Contact('09012345678', 'address1'))), param(
        'no contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=Employee('0001', 'employee_name1'))])
    def test_from_dict(self, _, input, expected):
        employee = Employee.from_dict(input)
        self.assertEqual(employee, expected)

    @parameterized.expand([param('no error', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=[]), param(
        'required employee_name', input={'employee_name': 'employee_name1',
        'contact': {'phone': '09012345678', 'address': 'address1'}},
        expected=[{'code': 'required', 'field': 'employee_id', 'message':
        'Invalid value for `employee_id`, must not be `None`'}]), param(
        'required contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=[{'code': 'required', 'field':
        'contact', 'message':
        'Invalid value for `contact`, must not be `None`'}]), param(
        'required phone', input={'employee_id': '0001', 'employee_name':
        'employee_name1', 'contact': {'address': 'address1'}}, expected=[{
        'code': 'required', 'field': 'contact.phone', 'message':
        'Invalid value for `phone`, must not be `None`'}])])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()
        self.assertEqual(errors, expected)


<mask token>

import unittest
from swagger_codegen.models.employee import Employee
from swagger_codegen.models.contact import Contact
from parameterized import parameterized, param


class TestEmployee(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @parameterized.expand([param('all', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=Employee('0001',
        'employee_name1', Contact('09012345678', 'address1'))), param(
        'no contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=Employee('0001', 'employee_name1'))])
    def test_from_dict(self, _, input, expected):
        employee = Employee.from_dict(input)
        self.assertEqual(employee, expected)

    @parameterized.expand([param('no error', input={'employee_id': '0001',
        'employee_name': 'employee_name1', 'contact': {'phone':
        '09012345678', 'address': 'address1'}}, expected=[]), param(
        'required employee_name', input={'employee_name': 'employee_name1',
        'contact': {'phone': '09012345678', 'address': 'address1'}},
        expected=[{'code': 'required', 'field': 'employee_id', 'message':
        'Invalid value for `employee_id`, must not be `None`'}]), param(
        'required contact', input={'employee_id': '0001', 'employee_name':
        'employee_name1'}, expected=[{'code': 'required', 'field':
        'contact', 'message':
        'Invalid value for `contact`, must not be `None`'}]), param(
        'required phone', input={'employee_id': '0001', 'employee_name':
        'employee_name1', 'contact': {'address': 'address1'}}, expected=[{
        'code': 'required', 'field': 'contact.phone', 'message':
        'Invalid value for `phone`, must not be `None`'}])])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()
        self.assertEqual(errors, expected)


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

import unittest
from swagger_codegen.models.employee import Employee
from swagger_codegen.models.contact import Contact
from parameterized import parameterized, param


class TestEmployee(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def setUp(self):
        pass

    def tearDown(self):
        pass

    @parameterized.expand([
        param(
            "all",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=Employee(
                "0001",
                "employee_name1",
                Contact(
                    "09012345678",
                    "address1"
                )
            )),
        param(
            "no contact",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                # "contact": {
                #     "phone": "09012345678",
                #     "address": "address1"
                # }
            },
            expected=Employee(
                "0001",
                "employee_name1"
            )),
    ])
    def test_from_dict(self, _, input, expected):
        employee = Employee.from_dict(input)

        self.assertEqual(employee, expected)

    @parameterized.expand([
        param(
            "no error",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[]),
        param(
            "required employee_name",
            input={
                # "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[
                {
                    "code": "required",
                    "field": "employee_id",
                    "message": "Invalid value for `employee_id`, must not be `None`"
                }
            ]),
        param(
            "required contact",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                # "contact": {
                #     "phone": "09012345678",
                #     "address": "address1"
                # }
            },
            expected=[
                {
                    "code": "required",
                    "field": "contact",
                    "message": "Invalid value for `contact`, must not be `None`"
                }
            ]),
        param(
            "required phone",
            input={
                "employee_id": "0001",
                "employee_name": "employee_name1",
                "contact": {
                    # "phone": "09012345678",
                    "address": "address1"
                }
            },
            expected=[
                {
                    "code": "required",
                    "field": "contact.phone",
                    "message": "Invalid value for `phone`, must not be `None`"
                }
            ]),
    ])
    def test_validate(self, _, input, expected):
        employee = Employee.from_dict(input)
        errors = employee.validate()

        self.assertEqual(errors, expected)


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