Commits

Gabriele Lanaro committed f352e99

test for date parsing: simple date case

Comments (0)

Files changed (1)

pyorg/tests/test_parser.py

 from attest import Assert, Tests
-from pyorg.parser import splitheads, maxhead, Node, parse_tags, parse_properties
+from pyorg.parser import splitheads, maxhead, Node, parse_tags, \
+    parse_properties, parse_date
+from datetime import date
 
 tpars = Tests()
 
     Assert(propdict['PROP_2']) == '10:00'
     Assert(propdict['SCHEDULE']) == '<2011-01-15>'
 
+@tpars.test
+def test_parse_date():
+    Assert(parse_date('<2011-01-15 mar>')) == date(2011, 1, 15) 
+
 if __name__ == '__main__':
     tpars.run()