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)
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)
def test_date(self): self.assertEqual('date(a)', XPath.date('a'))