# Path: neutron_taas/taas_client/osc/tap_service.py
# LOG = logging.getLogger(__name__)
# TAP_SERVICE = 'tap_service'
# TAP_SERVICES = '%ss' % TAP_SERVICE
# def _add_updatable_args(parser):
# def _updatable_args2body(parsed_args, body):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# class CreateTapService(command.ShowOne):
# class ListTapService(command.Lister):
# class ShowTapService(command.ShowOne):
# class DeleteTapService(command.Command):
# class UpdateTapService(command.ShowOne):
# 
# Path: neutron_taas/tests/unit/taas_client/osc/fakes.py
# class FakeTapService(object):
# class FakeTapFlow(object):
#     def create_tap_service(attrs=None):
#     def create_tap_services(attrs=None, count=1):
#     def create_tap_flow(attrs=None):
#     def create_tap_flows(attrs=None, count=1):


import copy
import operator
from unittest import mock
from neutronclient.tests.unit.osc.v2 import fakes as test_fakes
from osc_lib import utils as osc_utils
from osc_lib.utils import columns as column_util
from oslo_utils import uuidutils
from neutron_taas.taas_client.osc import tap_service as osc_tap_service
from neutron_taas.tests.unit.taas_client.osc import fakes

    def setUp(self):
        super(TestCreateTapService, self).setUp()
        self.cmd = osc_tap_service.CreateTapService(self.app, self.namespace)

    def test_create_tap_service(self):
        """Test Create Tap Service."""
        fake_tap_service = fakes.FakeTapService.create_tap_service(
            attrs={'port_id': uuidutils.generate_uuid()}
        )

        self.neutronclient.post = mock.Mock(
            return_value={osc_tap_service.TAP_SERVICE: fake_tap_service})
        arg_list = [
            '--name', fake_tap_service['name'],
            '--port', fake_tap_service['port_id'],
        ]

        verify_list = [
            ('name', fake_tap_service['name']),
            ('port_id', fake_tap_service['port_id']),
        ]

        parsed_args = self.check_parser(self.cmd, arg_list, verify_list)
        self.neutronclient.find_resource = mock.Mock(
            return_value={'id': fake_tap_service['port_id']})
        columns, data = self.cmd.take_action(parsed_args)
        self.neutronclient.post.assert_called_once_with(
            '/taas/tap_services',
            body={

# Path: neutron_taas/taas_client/osc/tap_service.py
# LOG = logging.getLogger(__name__)
# TAP_SERVICE = 'tap_service'
# TAP_SERVICES = '%ss' % TAP_SERVICE
# def _add_updatable_args(parser):
# def _updatable_args2body(parsed_args, body):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
#     def get_parser(self, prog_name):
#     def take_action(self, parsed_args):
# class CreateTapService(command.ShowOne):
# class ListTapService(command.Lister):
# class ShowTapService(command.ShowOne):
# class DeleteTapService(command.Command):
# class UpdateTapService(command.ShowOne):
# 
# Path: neutron_taas/tests/unit/taas_client/osc/fakes.py
# class FakeTapService(object):
# class FakeTapFlow(object):
#     def create_tap_service(attrs=None):
#     def create_tap_services(attrs=None, count=1):
#     def create_tap_flow(attrs=None):
#     def create_tap_flows(attrs=None, count=1):


# Path: neutron_taas/tests/unit/taas_client/osc/test_osc_tap_service.py
import copy
import operator
from unittest import mock
from neutronclient.tests.unit.osc.v2 import fakes as test_fakes
from osc_lib import utils as osc_utils
from osc_lib.utils import columns as column_util
from oslo_utils import uuidutils
from neutron_taas.taas_client.osc import tap_service as osc_tap_service
from neutron_taas.tests.unit.taas_client.osc import fakes


    def setUp(self):
        super(TestCreateTapService, self).setUp()
        self.cmd = osc_tap_service.CreateTapService(self.app, self.namespace)

    def test_create_tap_service(self):
        """Test Create Tap Service."""
        fake_tap_service = fakes.FakeTapService.create_tap_service(
            attrs={'port_id': uuidutils.generate_uuid()}
        )

        self.neutronclient.post = mock.Mock(
            return_value={osc_tap_service.TAP_SERVICE: fake_tap_service})
        arg_list = [
            '--name', fake_tap_service['name'],
            '--port', fake_tap_service['port_id'],
        ]

        verify_list = [
            ('name', fake_tap_service['name']),
            ('port_id', fake_tap_service['port_id']),
        ]

        parsed_args = self.check_parser(self.cmd, arg_list, verify_list)
        self.neutronclient.find_resource = mock.Mock(
            return_value={'id': fake_tap_service['port_id']})
        columns, data = self.cmd.take_action(parsed_args)
        self.neutronclient.post.assert_called_once_with(
            '/taas/tap_services',
            body={

                osc_tap_service.TAP_SERVICE: