本文整理匯總了Python中Naked.toolshed.types.XDict.equals方法的典型用法代碼示例。如果您正苦於以下問題:Python XDict.equals方法的具體用法?Python XDict.equals怎麽用?Python XDict.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Naked.toolshed.types.XDict
的用法示例。
在下文中一共展示了XDict.equals方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_xdict_equals_newobj_addattr
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_newobj_addattr(self):
xd = XDict({'key': 'value'})
xn = XDict({'key': 'value'})
xd.test = 'testing'
xn.test = 'testing'
self.assertTrue(hasattr(xd, 'test'))
self.assertTrue(hasattr(xn, 'test'))
self.assertTrue(xd.equals(xn))
self.assertTrue(xd == xn)
self.assertFalse(xd != xn)
示例2: test_xdict_equals_newobj_diff_dicttypes
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_newobj_diff_dicttypes(self):
xd = XDict({'key': '1'}, {'attrkey': 'attrval'})
xn = XDict({'key': 1}, {'attrkey': 'attrval'})
self.assertFalse(xd.equals(xn))
self.assertFalse(xd == xn)
self.assertTrue(xd != xn)
示例3: test_xdict_equals_newobj_diffattr_number
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_newobj_diffattr_number(self):
xd = XDict({'key': 'value'}, {'attrkey': 'attrval', 'another': 'test'})
xn = XDict({'key': 'value'}, {'attrkey': 'attrval'})
self.assertFalse(xd.equals(xn))
self.assertFalse(xd == xn)
self.assertTrue(xd != xn)
示例4: test_xdict_equals_newobj_diffattrval
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_newobj_diffattrval(self):
xd = XDict({'key': 'value'}, {'attrkey': 'diff'})
xn = XDict({'key': 'value'}, {'attrkey': 'attrval'})
self.assertFalse(xd.equals(xn))
self.assertFalse(xd == xn)
self.assertTrue(xd != xn)
示例5: test_xdict_equals_newobj_emptyattrs
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_newobj_emptyattrs(self):
xd = XDict({'key': 'value'})
xn = XDict({'key': 'value'})
self.assertTrue(xd.equals(xn))
self.assertTrue(xd == xn)
self.assertFalse(xd != xn)
示例6: test_xdict_equals_sameobj
# 需要導入模塊: from Naked.toolshed.types import XDict [as 別名]
# 或者: from Naked.toolshed.types.XDict import equals [as 別名]
def test_xdict_equals_sameobj(self):
xd = XDict({'key': 'value'}, {'attrkey': 'attrval'})
xn = xd
self.assertTrue(xd.equals(xn))
self.assertTrue(xd == xn)
self.assertFalse(xd != xn)