本文整理汇总了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')
示例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")
示例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' })
示例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')
示例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' })
示例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)
示例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)
示例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")
示例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')
示例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"}
)
示例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")
示例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')
示例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')
示例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')
示例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')