# Path: ecmcli/commands/base.py
# def toxml(data, root_tag='ecmcli'):
#     def crawl(obj, parent):
# def totuples(data):
#     def crawl(obj, path):
# def todict(obj, str_array_keys=False):
#     def api_complete(self, resource, field, startswith):
#     def make_completer(self, resource, field):
#         def cached(startswith):
#         def wrap(startswith, *args):
#     def api_search(self, resource, fields, terms, match='icontains',
#                    **options):
#     def res_flatten(self, resource, fields):
#     def confirm(self, msg, exit=True):
#     def make_searcher(self, resource, field_desc, **search_options):
#         def lookup(terms, **options):
#         def complete(startswith, args):
#     def add_completer_argument(self, *keys, resource=None, res_field=None,
#                                **options):
#     def add_router_argument(self, *keys, **options):
#     def add_group_argument(self, *keys, **options):
#     def add_account_argument(self, *keys, **options):
#     def add_product_argument(self, *keys, **options):
#     def add_firmware_argument(self, *keys, **options):
#     def add_role_argument(self, *keys, **options):
#     def add_user_argument(self, *keys, **options):
#     def add_search_argument(self, searcher, *keys, **options):
#     def inject_table_factory(self, *args, **kwargs):
#         def setup_make_table(argument_ns):
# class ECMCommand(shellish.Command):
# 
# Path: ecmcli/commands/remote.py
# class DeviceSelectorsMixin(object):
# class Get(DeviceSelectorsMixin, base.ECMCommand):
# class Set(DeviceSelectorsMixin, base.ECMCommand):
# class Diff(base.ECMCommand):
# class Remote(base.ECMCommand):
#     def setup_args(self, parser):
#     def api_res_lookup(self, *args, **kwargs):
#     def gen_selection_filters(self, args_namespace):
#     def completion_router_elect(self, **filters):
#     def try_complete_path(self, prefix, args=None):
#     def remote_lookup(self, rid_and_path):
#     def setup_args(self, parser):
#     def run(self, args):
#     def data_flatten(self, args, datafeed):
#         def responses():
#     def make_response_tree(self, resp):
#     def tree_format(self, args, results_feed, file):
#         def cook():
#     def table_format(self, args, results_feed, file):
#     def json_format(self, args, results_feed, file):
#     def xml_format(self, args, results_feed, file):
#     def csv_format(self, args, results_feed, file):
#     def setup_args(self, parser):
#     def run(self, args):
#     def setup_args(self, parser):
#     def complete_dtd_path(self, prefix, args=None):
#     def run(self, args):
#     def __init__(self, *args, **kwargs):


import copy
import unittest
from ecmcli.commands import base, remote
    def test_todict_listconv(self):
        case = {1: ['aaa', 'bbb']}
        result = {1: {0: 'aaa', 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)

    def test_todict_listconv_nested(self):
        case = {1: [{11: ['l2a', 'l2b']}, 'bbb']}
        result = {1: {0: {11: {0: 'l2a', 1: 'l2b'}}, 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)

    def test_todict_liststart(self):
        case = ["aaa", "bbb"]
        result = {0: 'aaa', 1: 'bbb'}
        self.assertEqual(base.todict(case), result)

    def test_todict_multi_dim_list(self):
        case = [["aaa", "bbb"]]
        result = {0: {0: 'aaa', 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)
        case = [["aaa", "bbb"], 1]
        result = {0: {0: 'aaa', 1: 'bbb'}, 1: 1}
        self.assertEqual(base.todict(case), result)
        case = [["aaa", "bbb"], []]
        result = {0: {0: 'aaa', 1: 'bbb'}, 1: {}}
        self.assertEqual(base.todict(case), result)
        case = [[['a']]]
        result = {0: {0: {0: 'a'}}}
        self.assertEqual(base.todict(case), result)
        case = [[[]]]
        result = {0: {0: {}}}

# Path: ecmcli/commands/base.py
# def toxml(data, root_tag='ecmcli'):
#     def crawl(obj, parent):
# def totuples(data):
#     def crawl(obj, path):
# def todict(obj, str_array_keys=False):
#     def api_complete(self, resource, field, startswith):
#     def make_completer(self, resource, field):
#         def cached(startswith):
#         def wrap(startswith, *args):
#     def api_search(self, resource, fields, terms, match='icontains',
#                    **options):
#     def res_flatten(self, resource, fields):
#     def confirm(self, msg, exit=True):
#     def make_searcher(self, resource, field_desc, **search_options):
#         def lookup(terms, **options):
#         def complete(startswith, args):
#     def add_completer_argument(self, *keys, resource=None, res_field=None,
#                                **options):
#     def add_router_argument(self, *keys, **options):
#     def add_group_argument(self, *keys, **options):
#     def add_account_argument(self, *keys, **options):
#     def add_product_argument(self, *keys, **options):
#     def add_firmware_argument(self, *keys, **options):
#     def add_role_argument(self, *keys, **options):
#     def add_user_argument(self, *keys, **options):
#     def add_search_argument(self, searcher, *keys, **options):
#     def inject_table_factory(self, *args, **kwargs):
#         def setup_make_table(argument_ns):
# class ECMCommand(shellish.Command):
# 
# Path: ecmcli/commands/remote.py
# class DeviceSelectorsMixin(object):
# class Get(DeviceSelectorsMixin, base.ECMCommand):
# class Set(DeviceSelectorsMixin, base.ECMCommand):
# class Diff(base.ECMCommand):
# class Remote(base.ECMCommand):
#     def setup_args(self, parser):
#     def api_res_lookup(self, *args, **kwargs):
#     def gen_selection_filters(self, args_namespace):
#     def completion_router_elect(self, **filters):
#     def try_complete_path(self, prefix, args=None):
#     def remote_lookup(self, rid_and_path):
#     def setup_args(self, parser):
#     def run(self, args):
#     def data_flatten(self, args, datafeed):
#         def responses():
#     def make_response_tree(self, resp):
#     def tree_format(self, args, results_feed, file):
#         def cook():
#     def table_format(self, args, results_feed, file):
#     def json_format(self, args, results_feed, file):
#     def xml_format(self, args, results_feed, file):
#     def csv_format(self, args, results_feed, file):
#     def setup_args(self, parser):
#     def run(self, args):
#     def setup_args(self, parser):
#     def complete_dtd_path(self, prefix, args=None):
#     def run(self, args):
#     def __init__(self, *args, **kwargs):


# Path: test/remote_config.py
import copy
import unittest
from ecmcli.commands import base, remote

    def test_todict_listconv(self):
        case = {1: ['aaa', 'bbb']}
        result = {1: {0: 'aaa', 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)

    def test_todict_listconv_nested(self):
        case = {1: [{11: ['l2a', 'l2b']}, 'bbb']}
        result = {1: {0: {11: {0: 'l2a', 1: 'l2b'}}, 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)

    def test_todict_liststart(self):
        case = ["aaa", "bbb"]
        result = {0: 'aaa', 1: 'bbb'}
        self.assertEqual(base.todict(case), result)

    def test_todict_multi_dim_list(self):
        case = [["aaa", "bbb"]]
        result = {0: {0: 'aaa', 1: 'bbb'}}
        self.assertEqual(base.todict(case), result)
        case = [["aaa", "bbb"], 1]
        result = {0: {0: 'aaa', 1: 'bbb'}, 1: 1}
        self.assertEqual(base.todict(case), result)
        case = [["aaa", "bbb"], []]
        result = {0: {0: 'aaa', 1: 'bbb'}, 1: {}}
        self.assertEqual(base.todict(case), result)
        case = [[['a']]]
        result = {0: {0: {0: 'a'}}}
        self.assertEqual(base.todict(case), result)
        case = [[[]]]
        result = {0: {0: {}}}

        self.assertEqual(base.todict(case), result)