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


Python PyObjC_TestClass3.setKeyValue_forObject_key_value_方法代码示例

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


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

示例1: testTakeValueForKey2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testTakeValueForKey2(self):
            o = KeyValueClass3()

            self.assertEquals(o.foo, u"foobar")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'foo', u'FOO')
            self.assertEquals(o.foo, u"FOO")

            self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUE_FORKEY, o, u'key9', u'IX')
开发者ID:aosm,项目名称:pyobjc,代码行数:10,代码来源:test_keyvalue.py

示例2: testTakeValueForKey2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testTakeValueForKey2(self):
            o = KeyValueClass3()

            self.assertEqual(o.foo, "foobar")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, "foo", "FOO")
            self.assertEqual(o.foo, "FOO")

            self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUE_FORKEY, o, "key9", "IX")
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:10,代码来源:test_keyvalue.py

示例3: testTakeValuesFromDictionary2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
    def testTakeValuesFromDictionary2(self):
        o = KeyValueClass3()

        self.assertEqual(o.foo, "foobar")
        STUB.setKeyValue_forObject_key_value_(DO_TAKEVALUESFROMDICT, o, None, { 'foo': 'FOO' })
        self.assertEqual(o.foo, "FOO")

        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_TAKEVALUESFROMDICT, o, None, { 'key9':  'IX' })
        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_TAKEVALUESFROMDICT, o, None, { 'roprop':  'IX' })
开发者ID:BMXE,项目名称:music-player,代码行数:11,代码来源:test_keyvalue.py

示例4: testStoredTakeValueForKey2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
    def testStoredTakeValueForKey2(self):
        o = KeyValueClass3()

        self.assertEqual(o.foo, "foobar")
        STUB.setKeyValue_forObject_key_value_(DO_TAKESTOREDVALUE_FORKEY, o, 'foo', 'FOO')
        self.assertEqual(o.foo, "FOO")

        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_TAKESTOREDVALUE_FORKEY, o, 'key9', 'IX')
        self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_TAKESTOREDVALUE_FORKEY, o, 'roprop', 'IX')
开发者ID:BMXE,项目名称:music-player,代码行数:11,代码来源:test_keyvalue.py

示例5: testSetValuesForKeysFromDictionary2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValuesForKeysFromDictionary2(self):
            o = KeyValueClass3()

            self.assertEquals(o.foo, u"foobar")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUESFORKEYSFROMDICT, o, None, { u'foo': u'FOO' })
            self.assertEquals(o.foo, u"FOO")

            self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUESFORKEYSFROMDICT, o, None, { u'key9': u'IX' })
            self.assertRaises(KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUESFORKEYSFROMDICT, o, None, { u'roprop': u'IX' })
开发者ID:aosm,项目名称:pyobjc,代码行数:11,代码来源:test_keyvalue.py

示例6: testTakeValueForKeyPath

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
    def testTakeValueForKeyPath(self):
        o = KeyValueClass2()
        o.addMultiple()

        self.assertEqual(o.multiple.level2.level3.keyA, "hello")
        self.assertEqual(o.multiple.level2.level3.keyB, "world")

        STUB.setKeyValue_forObject_key_value_(DO_TAKEVALUE_FORKEYPATH, o, "multiple.level2.level3.keyA", "KeyAValue")
        self.assertEqual(o.multiple.level2.level3.keyA, "KeyAValue")

        STUB.setKeyValue_forObject_key_value_(DO_TAKEVALUE_FORKEYPATH, o, "multiple.level2.level3.keyB", 9.999)
        self.assertEqual(o.multiple.level2.level3.keyB, 9.999)
开发者ID:BMXE,项目名称:music-player,代码行数:14,代码来源:test_keyvalue.py

示例7: testSetValueForKeyPath

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValueForKeyPath(self):
            o = KeyValueClass2()
            o.addMultiple()

            self.assertEquals(o.multiple.level2.level3.keyA, u"hello")
            self.assertEquals(o.multiple.level2.level3.keyB, u"world")

            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEYPATH, o, u"multiple.level2.level3.keyA", u"KeyAValue")
            self.assertEquals(o.multiple.level2.level3.keyA, u"KeyAValue")

            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEYPATH, o, u"multiple.level2.level3.keyB", 9.999)
            self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
开发者ID:aosm,项目名称:pyobjc,代码行数:14,代码来源:test_keyvalue.py

示例8: testPythonConvention

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testPythonConvention(self):
            o = KeyValueClass2()

            self.assertEqual(o._pythonConvention, "BAD")
            self.assertEqual(o.pythonConvention(), "GOOD")
            self.assertEqual(o._pythonConventionValue, "GOOD")
            self.assertEqual(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, "pythonConvention"), "GOOD")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, "pythonConvention", "CHANGED")
            self.assertEqual(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, "pythonConvention"), "CHANGED")
            self.assertEqual(o._pythonConvention, "BAD")
            self.assertEqual(o.pythonConvention(), "CHANGED")
            self.assertEqual(o._pythonConventionValue, "CHANGED")
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:14,代码来源:test_keyvalue.py

示例9: testPythonConvention

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testPythonConvention(self):
            o = KeyValueClass2()

            self.assertEquals(o._pythonConvention, u'BAD')
            self.assertEquals(o.pythonConvention(), u'GOOD')
            self.assertEquals(o._pythonConventionValue, u'GOOD')
            self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"pythonConvention"), u'GOOD')
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'pythonConvention', u'CHANGED')
            self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"pythonConvention"), u'CHANGED')
            self.assertEquals(o._pythonConvention, u'BAD')
            self.assertEquals(o.pythonConvention(), u'CHANGED')
            self.assertEquals(o._pythonConventionValue, u'CHANGED')
开发者ID:aosm,项目名称:pyobjc,代码行数:14,代码来源:test_keyvalue.py

示例10: testSetValuesForKeysFromDictionary2

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValuesForKeysFromDictionary2(self):
            o = KeyValueClass3()

            self.assertEqual(o.foo, "foobar")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUESFORKEYSFROMDICT, o, None, {"foo": "FOO"})
            self.assertEqual(o.foo, "FOO")

            self.assertRaises(
                KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUESFORKEYSFROMDICT, o, None, {"key9": "IX"}
            )
            self.assertRaises(
                KeyError, STUB.setKeyValue_forObject_key_value_, DO_SETVALUESFORKEYSFROMDICT, o, None, {"roprop": "IX"}
            )
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:15,代码来源:test_keyvalue.py

示例11: testSetValuesForKeysFromDictionary

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValuesForKeysFromDictionary(self):
            o = KeyValueClass2()

            self.assertEqual(o.key3, 3)
            self.assertEqual(o._key4, "4")
            o.key5 = 1
            self.assertNotHasAttr(o, "key9")

            STUB.setKeyValue_forObject_key_value_(
                DO_SETVALUESFORKEYSFROMDICT, o, None, {"key3": "drie", "key4": "vier", "key5": "V", "key9": "IX"}
            )

            self.assertEqual(o.key3, "drie")
            self.assertEqual(o._key4, "viervierviervier")
            self.assertEqual(o.key5, "VVVVV")
            self.assertHasAttr(o, "key9")
            self.assertEqual(o.key9, "IX")
开发者ID:GreatFruitOmsk,项目名称:pyobjc-core,代码行数:19,代码来源:test_keyvalue.py

示例12: testSetValuesForKeysFromDictionary

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValuesForKeysFromDictionary(self):
            o = KeyValueClass2()

            self.assertEqual(o.key3, 3)
            self.assertEqual(o._key4, "4")
            o.key5 = 1
            self.assertNotHasAttr(o, 'key9')

            STUB.setKeyValue_forObject_key_value_(DO_SETVALUESFORKEYSFROMDICT, o, None,
                {
                    'key3': 'drie',
                    'key4': 'vier',
                    'key5': 'V',
                    'key9': 'IX',
                })

            self.assertEqual(o.key3, "drie")
            self.assertEqual(o._key4, "viervierviervier")
            self.assertEqual(o.key5, "VVVVV")
            self.assertHasAttr(o, 'key9')
            self.assertEqual(o.key9, 'IX')
开发者ID:BMXE,项目名称:music-player,代码行数:23,代码来源:test_keyvalue.py

示例13: testSetValuesForKeysFromDictionary

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValuesForKeysFromDictionary(self):
            o = KeyValueClass2()

            self.assertEquals(o.key3, 3)
            self.assertEquals(o._key4, u"4")
            o.key5 = 1
            self.assert_(not hasattr(o, u'key9'))

            STUB.setKeyValue_forObject_key_value_(DO_SETVALUESFORKEYSFROMDICT, o, None,
                {
                    u'key3': u'drie',
                    u'key4': u'vier',
                    u'key5': u'V',
                    u'key9': u'IX',
                })

            self.assertEquals(o.key3, u"drie")
            self.assertEquals(o._key4, u"viervierviervier")
            self.assertEquals(o.key5, u"VVVVV")
            self.assert_(hasattr(o, u'key9'))
            self.assertEquals(o.key9, u'IX')
开发者ID:aosm,项目名称:pyobjc,代码行数:23,代码来源:test_keyvalue.py

示例14: testTakeValuesFromDictionary

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
    def testTakeValuesFromDictionary(self):
        o = KeyValueClass2()

        self.assertEquals(o.key3, 3)
        self.assertEquals(o._key4, u"4")
        o.key5 = 1
        self.assertNotHasAttr(o, u'key9')

        STUB.setKeyValue_forObject_key_value_(DO_TAKEVALUESFROMDICT, o, None,
            {
                u'key3': u'drie',
                u'key4': u'vier',
                u'key5': u'V',
                u'key9': u'IX',
            })

        self.assertEquals(o.key3, u"drie")
        self.assertEquals(o._key4, u"viervierviervier")
        self.assertEquals(o.key5, u"VVVVV")
        self.assertHasAttr(o, u'key9')
        self.assertEquals(o.key9, u'IX')
开发者ID:aosm,项目名称:pyobjc,代码行数:23,代码来源:test_keyvalue.py

示例15: testSetValueForKey

# 需要导入模块: from PyObjCTest.testbndl import PyObjC_TestClass3 [as 别名]
# 或者: from PyObjCTest.testbndl.PyObjC_TestClass3 import setKeyValue_forObject_key_value_ [as 别名]
        def testSetValueForKey(self):
            o = KeyValueClass2()

            self.assertEquals(o.key3, 3)
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'key3', u'drie')
            self.assertEquals(o.key3, u"drie")

            self.assertEquals(o._key4, u"4")
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'key4', u'vier')
            self.assertEquals(o._key4, u"viervierviervier")

            o.key5 = 1
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'key5', u'V')
            self.assertEquals(o.key5, u"VVVVV")

            self.assert_(not hasattr(o, u'key9'))
            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'key9', u'IX')
            self.assert_(hasattr(o, u'key9'))
            self.assertEquals(o.key9, u'IX')
开发者ID:aosm,项目名称:pyobjc,代码行数:21,代码来源:test_keyvalue.py


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