def test_attribute_before(): result = parse({ "before": [ {"property": "attr"}, "2000-01-01T00:00:01Z", ] }) assert result == ast.TimeBefore( ast.Attribute('attr'), datetime( 2000, 1, 1, 0, 0, 1, tzinfo=StaticTzInfo('Z', timedelta(0)) ), )
def test_attribute_before(): result = parse( { "op": "t_before", "args": [ {"property": "attr"}, {"timestamp": "2000-01-01T00:00:01Z"}, ], } ) assert result == ast.TimeBefore( ast.Attribute("attr"), datetime(2000, 1, 1, 0, 0, 1, tzinfo=StaticTzInfo("Z", timedelta(0))), )
def test_before(): # using timePosition directly result = parse(''' <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema-datatypes" xmlns:gml="http://www.opengis.net/gml"> <fes:Before> <fes:ValueReference>attr</fes:ValueReference> <gml:timePosition>2000-01-01T00:00:00Z</gml:timePosition> </fes:Before> </fes:Filter> ''') assert result == ast.TimeBefore( ast.Attribute('attr'), datetime(2000, 1, 1, 0, 0, 0, tzinfo=StaticTzInfo('Z', timedelta(0))), )
def test_attribute_before(): result = parse('attr BEFORE 2000-01-01T00:00:01Z') assert result == ast.TimeBefore( ast.Attribute('attr'), datetime(2000, 1, 1, 0, 0, 1, tzinfo=StaticTzInfo('Z', timedelta(0))), )