def test_get_subtree_2_level(self):
        leaf0 = {
            'key': "/test/leaf0",
            'value': "hello1",
            'expiration': None,
            'ttl': None,
            'modifiedIndex': 5,
            'createdIndex': 1,
            'newKey': False,
            'dir': False,
        }
        leaf1 = {
            'key': "/test/leaf1",
            'value': "hello2",
            'expiration': None,
            'ttl': None,
            'modifiedIndex': 6,
            'createdIndex': 2,
            'newKey': False,
            'dir': False,
        }
        testnode = {"node": {
            'key': "/test/",
            'expiration': None,
            'ttl': None,
            'modifiedIndex': 6,
            'createdIndex': 2,
            'newKey': False,
            'dir': True,
            'nodes': [leaf0, leaf1]
        }}
        result = etcd.EtcdResult(**testnode)
        self.assertEqual(result.key, "/test/")
        self.assertTrue(result.dir)

        # Get subtree returns just two leaves for leaves only.
        subtree = list(result.get_subtree(leaves_only=True))
        self.assertEqual(subtree[0].key, "/test/leaf0")
        self.assertEqual(subtree[1].key, "/test/leaf1")
        self.assertEqual(len(subtree), 2)

        # Get subtree returns leaves and directory.
        subtree = list(result.get_subtree(leaves_only=False))
        self.assertEqual(subtree[0].key, "/test/")
        self.assertEqual(subtree[1].key, "/test/leaf0")
        self.assertEqual(subtree[2].key, "/test/leaf1")
        self.assertEqual(len(subtree), 3)
Does nothing for the BaseRange class. Used in the Range class to
dataset/ETHPy150Open jplana/python-etcd/src/etcd/tests/unit/test_result.py/TestEtcdResult.test_get_subtree_2_level--crossover with--dataset/ETHPy150Open enthought/traits/traits/trait_types.py/BaseRange.init_fast_validator