def test_update_servicechain_node_unset_nodes(self): resource = 'servicechain_spec' cmd = servicechain.UpdateServiceChainSpec(test_cli20.MyApp(sys.stdout), None) nodes_arg = '' nodes_res = [] body = {'nodes': nodes_res} args = ['myid', '--nodes', nodes_arg] self._test_update_resource(resource, cmd, 'myid', args, body)
def test_update_servicechain_spec(self): """service-chain-spec-update myid --name myname --tags a b.""" resource = 'servicechain_spec' cmd = servicechain.UpdateServiceChainSpec(test_cli20.MyApp(sys.stdout), None) self._test_update_resource(resource, cmd, 'myid', ['myid', '--name', 'myname', '--tags', 'a', 'b'], {'name': 'myname', 'tags': ['a', 'b'], })
def test_update_servicechain_spec_with_nodes(self): resource = 'servicechain_spec' cmd = servicechain.UpdateServiceChainSpec(test_cli20.MyApp(sys.stdout), None) nodes_arg = 'node1 node2' nodes_res = ['node1', 'node2'] description = 'My Service Chain Spec' body = { 'nodes': nodes_res, 'description': description } args = ['myid', '--nodes', nodes_arg, '--description', description] self._test_update_resource(resource, cmd, 'myid', args, body)
def test_update_servicechain_node_with_all_params(self): resource = 'servicechain_spec' cmd = servicechain.UpdateServiceChainSpec(test_cli20.MyApp(sys.stdout), None) shared = 'true' nodes_arg = 'node1,node2' nodes_res = ['node1', 'node2'] body = { 'name': 'new_name', 'description': 'new_description', 'nodes': nodes_res, 'shared': shared } args = [ 'myid', '--name', 'new_name', '--description', 'new_description', '--nodes', nodes_arg, '--shared', shared ] self._test_update_resource(resource, cmd, 'myid', args, body)