本文整理汇总了Python中corehq.apps.app_manager.xpath.XPath.or_方法的典型用法代码示例。如果您正苦于以下问题:Python XPath.or_方法的具体用法?Python XPath.or_怎么用?Python XPath.or_使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corehq.apps.app_manager.xpath.XPath
的用法示例。
在下文中一共展示了XPath.or_方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_complex
# 需要导入模块: from corehq.apps.app_manager.xpath import XPath [as 别名]
# 或者: from corehq.apps.app_manager.xpath.XPath import or_ [as 别名]
def test_complex(self):
xp = XPath.and_(
XPath('a').eq('1'),
XPath('b').neq(XPath.string('')),
XPath.or_(
XPath('c').eq(XPath.string('')),
XPath.date('d').neq('today()')
))
self.assertEqual("a = 1 and b != '' and (c = '' or date(d) != today())", xp)
示例2: test_not
# 需要导入模块: from corehq.apps.app_manager.xpath import XPath [as 别名]
# 或者: from corehq.apps.app_manager.xpath.XPath import or_ [as 别名]
def test_not(self):
self.assertEqual('not a', XPath.not_('a'))
self.assertEqual('not (a or b)', XPath.not_(XPath.or_('a', 'b')))
示例3: test_and_or
# 需要导入模块: from corehq.apps.app_manager.xpath import XPath [as 别名]
# 或者: from corehq.apps.app_manager.xpath.XPath import or_ [as 别名]
def test_and_or(self):
self.assertEqual('a and b and c', XPath.and_('a', 'b', 'c'))
self.assertEqual('a and (b and c)', XPath.and_('a', XPath.and_('b', 'c')))
self.assertEqual('a or b or c', XPath.or_('a', 'b', 'c'))
self.assertEqual('(a or b) or c', XPath.or_(XPath.or_('a', 'b'), XPath('c')))