# Path: acos_client/v30/slb/port.py
# class Port(base.BaseV30):
#     def create(self, server_name, port, protocol, max_retries=None, timeout=None,
#                conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
#                weight=1, range=0, action="enable", **kwargs):
#     def update(self, server_name, port, protocol, max_retries=None, timeout=None,
#                conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
#                weight=1, range=0, action="enable", **kwargs):
#     def delete(self, server_name, port, protocol, **kwargs):
#     def _set(self, server_name, port, protocol, conn_resume=None, conn_limit=None,
#              stats_data_action="stats-data-enable", weight=1, range=0, action="enable"):


    import unittest
    import mock
    import unittest2 as unittest
    from unittest import mock
from acos_client.v30.slb import port
                "protocol": 'tcp'
            }
        }
        self.port.create('test_server', 80, 'tcp', conn_resume=500, conn_limit=600,
                         stats_data_action="stats-data-disable", weight=3, range=30,
                         action="disable-with-health-check")

        ((method, url, params, header), kwargs) = self.client.http.request.call_args

        self.assertEqual(method, 'POST')
        self.assertEqual(url, '/axapi/v3/slb/server/%s/port/' % self._server_name)
        self.assertEqual(params, expected)

    def test_update_port(self):
        expected = {
            'port': {
                "conn-resume": 500,
                "conn-limit": 600,
                "stats-data-action": "stats-data-disable",
                "weight": 3,
                "port-number": 80,
                "range": 30,
                "action": "disable-with-health-check",
                "protocol": 'tcp'
            }
        }
        self.port.update('test_server', 80, 'tcp', conn_resume=500, conn_limit=600,
                         stats_data_action="stats-data-disable", weight=3, range=30,
                         action="disable-with-health-check")


# Path: acos_client/v30/slb/port.py
# class Port(base.BaseV30):
#     def create(self, server_name, port, protocol, max_retries=None, timeout=None,
#                conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
#                weight=1, range=0, action="enable", **kwargs):
#     def update(self, server_name, port, protocol, max_retries=None, timeout=None,
#                conn_resume=None, conn_limit=None, stats_data_action="stats-data-enable",
#                weight=1, range=0, action="enable", **kwargs):
#     def delete(self, server_name, port, protocol, **kwargs):
#     def _set(self, server_name, port, protocol, conn_resume=None, conn_limit=None,
#              stats_data_action="stats-data-enable", weight=1, range=0, action="enable"):


# Path: acos_client/tests/unit/v30/test_port.py
    import unittest
    import mock
    import unittest2 as unittest
    from unittest import mock
from acos_client.v30.slb import port

                "protocol": 'tcp'
            }
        }
        self.port.create('test_server', 80, 'tcp', conn_resume=500, conn_limit=600,
                         stats_data_action="stats-data-disable", weight=3, range=30,
                         action="disable-with-health-check")

        ((method, url, params, header), kwargs) = self.client.http.request.call_args

        self.assertEqual(method, 'POST')
        self.assertEqual(url, '/axapi/v3/slb/server/%s/port/' % self._server_name)
        self.assertEqual(params, expected)

    def test_update_port(self):
        expected = {
            'port': {
                "conn-resume": 500,
                "conn-limit": 600,
                "stats-data-action": "stats-data-disable",
                "weight": 3,
                "port-number": 80,
                "range": 30,
                "action": "disable-with-health-check",
                "protocol": 'tcp'
            }
        }
        self.port.update('test_server', 80, 'tcp', conn_resume=500, conn_limit=600,
                         stats_data_action="stats-data-disable", weight=3, range=30,
                         action="disable-with-health-check")


        ((method, url, params, header), kwargs) = self.client.http.request.call_args