コード例 #1
0
ファイル: test_util.py プロジェクト: wenshiqi0/gecko-dev
    def test_merge(self):
        l1 = HierarchicalStringList()
        l1 += ['root1', 'root2', 'root3']
        l1.child1 += ['child11', 'child12', 'child13']
        l1.child1.grandchild1 += ['grandchild111', 'grandchild112']
        l1.child1.grandchild2 += ['grandchild121', 'grandchild122']
        l1.child2.grandchild1 += ['grandchild211', 'grandchild212']
        l1.child2.grandchild1 += ['grandchild213', 'grandchild214']
        l2 = HierarchicalStringList()
        l2.child1 += ['child14', 'child15']
        l2.child1.grandchild2 += ['grandchild123']
        l2.child3 += ['child31', 'child32']

        l1 += l2
        els = list((path, list(seq)) for path, seq in l1.walk())
        self.assertEqual(els, [
            ('', ['root1', 'root2', 'root3']),
            ('child1', ['child11', 'child12', 'child13', 'child14', 'child15'
                        ]),
            ('child1/grandchild1', ['grandchild111', 'grandchild112']),
            ('child1/grandchild2',
             ['grandchild121', 'grandchild122', 'grandchild123']),
            ('child2/grandchild1', [
                'grandchild211', 'grandchild212', 'grandchild213',
                'grandchild214'
            ]),
            ('child3', ['child31', 'child32']),
        ])
コード例 #2
0
ファイル: test_util.py プロジェクト: Floflis/gecko-b2g
    def test_walk(self):
        l = HierarchicalStringList()
        l += ["root1", "root2", "root3"]
        l.child1 += ["child11", "child12", "child13"]
        l.child1.grandchild1 += ["grandchild111", "grandchild112"]
        l.child1.grandchild2 += ["grandchild121", "grandchild122"]
        l.child2.grandchild1 += ["grandchild211", "grandchild212"]
        l.child2.grandchild1 += ["grandchild213", "grandchild214"]

        els = list((path, list(seq)) for path, seq in l.walk())
        self.assertEqual(
            els,
            [
                ("", ["root1", "root2", "root3"]),
                ("child1", ["child11", "child12", "child13"]),
                ("child1/grandchild1", ["grandchild111", "grandchild112"]),
                ("child1/grandchild2", ["grandchild121", "grandchild122"]),
                (
                    "child2/grandchild1",
                    [
                        "grandchild211",
                        "grandchild212",
                        "grandchild213",
                        "grandchild214",
                    ],
                ),
            ],
        )
コード例 #3
0
ファイル: test_util.py プロジェクト: Floflis/gecko-b2g
    def test_merge(self):
        l1 = HierarchicalStringList()
        l1 += ["root1", "root2", "root3"]
        l1.child1 += ["child11", "child12", "child13"]
        l1.child1.grandchild1 += ["grandchild111", "grandchild112"]
        l1.child1.grandchild2 += ["grandchild121", "grandchild122"]
        l1.child2.grandchild1 += ["grandchild211", "grandchild212"]
        l1.child2.grandchild1 += ["grandchild213", "grandchild214"]
        l2 = HierarchicalStringList()
        l2.child1 += ["child14", "child15"]
        l2.child1.grandchild2 += ["grandchild123"]
        l2.child3 += ["child31", "child32"]

        l1 += l2
        els = list((path, list(seq)) for path, seq in l1.walk())
        self.assertEqual(
            els,
            [
                ("", ["root1", "root2", "root3"]),
                ("child1",
                 ["child11", "child12", "child13", "child14", "child15"]),
                ("child1/grandchild1", ["grandchild111", "grandchild112"]),
                (
                    "child1/grandchild2",
                    ["grandchild121", "grandchild122", "grandchild123"],
                ),
                (
                    "child2/grandchild1",
                    [
                        "grandchild211",
                        "grandchild212",
                        "grandchild213",
                        "grandchild214",
                    ],
                ),
                ("child3", ["child31", "child32"]),
            ],
        )
コード例 #4
0
ファイル: test_util.py プロジェクト: sx5486510/rotor-browser
    def test_walk(self):
        l = HierarchicalStringList()
        l += ['root1', 'root2', 'root3']
        l.child1 += ['child11', 'child12', 'child13']
        l.child1.grandchild1 += ['grandchild111', 'grandchild112']
        l.child1.grandchild2 += ['grandchild121', 'grandchild122']
        l.child2.grandchild1 += ['grandchild211', 'grandchild212']
        l.child2.grandchild1 += ['grandchild213', 'grandchild214']

        els = list((path, list(seq)) for path, seq in l.walk())
        self.assertEqual(els, [
            ('', ['root1', 'root2', 'root3']),
            ('child1', ['child11', 'child12', 'child13']),
            ('child1/grandchild1', ['grandchild111', 'grandchild112']),
            ('child1/grandchild2', ['grandchild121', 'grandchild122']),
            ('child2/grandchild1', ['grandchild211', 'grandchild212',
                                    'grandchild213', 'grandchild214']),
        ])
コード例 #5
0
ファイル: sandbox_symbols.py プロジェクト: memorais/TC2_impl
        This is a substitute for AC_OUTPUT in autoconf. For each path in this
        list, we will search for a file in the srcdir having the name
        {path}.in. The contents of this file will be read and variable patterns
        like @foo@ will be substituted with the values of the AC_SUBST
        variables declared during configure.
        """),
    'MODULE': (unicode, "", """Module name.

        Historically, this variable was used to describe where to install header
        files, but that feature is now handled by EXPORTS_NAMESPACES. Currently
        it is used as the XPIDL module name if XPIDL_MODULE is not defined, but
        using XPIDL_MODULE directly is preferred. MODULE will likely be removed
        in the future.
        """),
    'EXPORTS': (HierarchicalStringList, HierarchicalStringList(),
                """List of files to be exported, and in which subdirectories.

        EXPORTS is generally used to list the include files to be exported to
        dist/include, but it can be used for other files as well. This variable
        behaves as a list when appending filenames for export in the top-level
        directory. Files can also be appended to a field to indicate which
        subdirectory they should be exported to. For example, to export 'foo.h'
        to the top-level directory, and 'bar.h' to mozilla/dom/, append to
        EXPORTS like so:

        EXPORTS += ['foo.h']
        EXPORTS.mozilla.dom += ['bar.h']
        """),

    # IDL Generation.
コード例 #6
0
ファイル: test_util.py プロジェクト: Floflis/gecko-b2g
 def setUp(self):
     self.EXPORTS = HierarchicalStringList()