当前位置: 首页>>代码示例>>Python>>正文


Python TreeDict.b方法代码示例

本文整理汇总了Python中treedict.TreeDict.b方法的典型用法代码示例。如果您正苦于以下问题:Python TreeDict.b方法的具体用法?Python TreeDict.b怎么用?Python TreeDict.b使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在treedict.TreeDict的用法示例。


在下文中一共展示了TreeDict.b方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testUpdate_WithFreezing_ValuesOnly_03

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testUpdate_WithFreezing_ValuesOnly_03(self):

        p = TreeDict()

        p.b = 1
        p.freeze(values_only=True)

        q = TreeDict()
        q.b = 2

        self.assertRaises(TypeError, lambda: p.update(q))
开发者ID:humm,项目名称:treedict,代码行数:13,代码来源:test_update.py

示例2: testDangling_14_CorrectParentingSetAtFixing_03

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testDangling_14_CorrectParentingSetAtFixing_03(self):

        p = TreeDict()
        v = unique_object()

        p.b = p.c
        p.a = p.b

        # Set c and fix p.b
        p.c = 1
        p.b = 1
        p.a.x = 1

        # Now b should be
        self.assert_(p.a.branchName() == 'a')
开发者ID:aurora1625,项目名称:treedict,代码行数:17,代码来源:test_branches.py

示例3: testDangling_14_CorrectParentingSetAtFixing_05

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testDangling_14_CorrectParentingSetAtFixing_05(self):

        p = TreeDict()

        p.makeBranch('cc')

        p.b = p.cc.c
        p.aa.a = p.b

        # Set c and fix p.b
        p.cc.c = 1
        p.b = 1

        # Now b should be
        self.assert_(p.aa.a.branchName() == 'a')
开发者ID:aurora1625,项目名称:treedict,代码行数:17,代码来源:test_branches.py

示例4: testMutability_03

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testMutability_03(self):
        # Makes sure that stored branches are handled correctly
        
        p1 = TreeDict('root')
        
        p1.a = (13, (123, 32))
        p1.b = 123
        p1.c.a = 145
        p1.c.b = "1231321321231321"
        
        p2 = TreeDict('node')

        p2.a = 432

        p1.node = p2

        self.assert_(p1.isMutable())

        p1.freeze()
        
        self.assert_(p1.isMutable())

        p2.freeze()
        
        self.assert_(not p1.isMutable())
开发者ID:real666maverick,项目名称:treedict,代码行数:27,代码来源:test_properties.py

示例5: testIterators_14_Links_are_not_branches_02

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testIterators_14_Links_are_not_branches_02(self):

        p = TreeDict()
        p.a.x = 1
        p.b = p.a

        self.assert_('b' not in p.keys(recursive = False, branch_mode = 'only'))
开发者ID:real666maverick,项目名称:treedict,代码行数:9,代码来源:test_iterators_lists.py

示例6: testOrdering_01

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testOrdering_01(self):
        t = TreeDict()

        t.a = 1
        t.b = 2

        self.assert_(t._getSettingOrderPosition('a') == (0,), t._getSettingOrderPosition('a'))
        self.assert_(t._getSettingOrderPosition('b') == (1,), t._getSettingOrderPosition('b'))
开发者ID:aurora1625,项目名称:treedict,代码行数:10,代码来源:test_setting.py

示例7: test_existance_06b_dangling_node

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def test_existance_06b_dangling_node(self):
        p = TreeDict('roor')

        p.b = 123
        p.a

        self.assert_('b' in p)
        self.assert_('a' not in p)
开发者ID:aurora1625,项目名称:treedict,代码行数:10,代码来源:test_retrieval.py

示例8: test01

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
 def test01(self):
     
     test_tree = TreeDict()
     test_tree.x = 1
     test_tree.a = 1
     test_tree.b = 2
     
     runTest([], 'data', test_tree)
开发者ID:aurora1625,项目名称:lazyrunner,代码行数:10,代码来源:tests.py

示例9: test02

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
 def test02(self):
     
     test_tree = TreeDict()
     test_tree.x = 1
     test_tree.a = 10
     test_tree.b = 2
     
     runTest(['change_default_a'], 'data', test_tree)
开发者ID:aurora1625,项目名称:lazyrunner,代码行数:10,代码来源:tests.py

示例10: test03

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
 def test03(self):
     
     test_tree = TreeDict()
     test_tree.x = 2
     test_tree.a = 1
     test_tree.b = 2
     
     runTest(['data.set_X_2'], 'data', test_tree)
开发者ID:aurora1625,项目名称:lazyrunner,代码行数:10,代码来源:tests.py

示例11: testCopying_07a_Regression

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testCopying_07a_Regression(self):

        p = TreeDict()

        p.a.b = [1,2,3,4,534]
        p.a.c = [1,22,534]
        p.b   = [1,2,3]

        p2 = TreeDict()

        p2.a.b = [1,2,3,4,534]
        p2.a.c = [1,22,534]
        p2.b   = [1,2,3]

        p3 = copy(p)
        
        self.assert_(p == p2)
        self.assert_(p == p3)
开发者ID:aurora1625,项目名称:treedict,代码行数:20,代码来源:test_copying.py

示例12: testDrySet_04_value_overwrite

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testDrySet_04_value_overwrite(self):
        p = TreeDict()
        p.b = 1

        p_before = p.copy()

        self.assertRaises(TypeError, lambda: p.checkset("b.a", None, protect_structure = True))

        self.assert_(p_before == p)
开发者ID:aurora1625,项目名称:treedict,代码行数:11,代码来源:test_setting.py

示例13: testPickling_Dangling_03

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testPickling_Dangling_03(self):

        p = TreeDict()
        p.a = p.b = p.c
        
        p.b = 2

        p2 = cPickle.loads(cPickle.dumps(p, protocol=2))

        self.assert_(p2 == p)
开发者ID:real666maverick,项目名称:treedict,代码行数:12,代码来源:test_pickling.py

示例14: testCopying_09_LinkedValuesPreserved

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testCopying_09_LinkedValuesPreserved(self):

        p = TreeDict()
        p.a.x = 1
        p.b = p.a

        q = p.copy()

        self.assert_(p.a is not q.a)
        self.assert_(q.b is q.a)
开发者ID:aurora1625,项目名称:treedict,代码行数:12,代码来源:test_copying.py

示例15: testDangling_11_ReferenceEquivalence_01

# 需要导入模块: from treedict import TreeDict [as 别名]
# 或者: from treedict.TreeDict import b [as 别名]
    def testDangling_11_ReferenceEquivalence_01(self):

        p = TreeDict()

        b = p.a = p.b

        self.assert_(p.a is p.b)

        p.b = 1

        self.assert_(p.a is b)
开发者ID:aurora1625,项目名称:treedict,代码行数:13,代码来源:test_branches.py


注:本文中的treedict.TreeDict.b方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。