def left_denotation(self, left): super(SymbolTernaryInRange, self).left_denotation(left) for child in self.children[1:]: if child.is_literal() and not utils.is_iso8601_date(child.value): raise SyntaxError("invalid date '%s' in 'in_range ... to'" % child.value) return self
def left_denotation(self, left): super(SymbolTernaryInRange, self).left_denotation(left) for child in self.children[1:]: if child.is_literal() and not utils.is_iso8601_date(child.value): raise SyntaxError( "invalid date '%s' in 'in_range ... to'" % child.value ) return self
def testIsIso8601Date(self): self.assertTrue(utils.is_iso8601_date("2014-07-03")) self.assertTrue(utils.is_iso8601_date("2014-07-03T11:35:14")) self.assertTrue(utils.is_iso8601_date("20140703")) self.assertTrue(utils.is_iso8601_date("2014-W27-4")) self.assertTrue(utils.is_iso8601_date("2014-184")) self.assertFalse(utils.is_iso8601_date("")) self.assertFalse(utils.is_iso8601_date("foo")) self.assertFalse(utils.is_iso8601_date("2014-07-32")) self.assertFalse(utils.is_iso8601_date("2014-13-03")) self.assertFalse(utils.is_iso8601_date("2014-W27-8")) self.assertFalse(utils.is_iso8601_date("2014-367"))