Nodes with only the heading returned OrgDate(None) for all SDC dates whereas nodes with multiple lines had the more precise object OrgDateScheduled(None)/... This PR harmonizes these cases by returning the more precise object in each case.
I also hardened the parsing tests by adding a type check (strict type equality between parsed and expected). The type check could be relaxed by checking that the parsed object is a subclass of the expected type.
With the PR, the example in #40 gives:
from orgparse import loads
r0 = loads("""* Heading 1
* Heading 2
body""")
print([c.scheduled for c in r0.children]) # prints [OrgDateScheduled(None), OrgDateScheduled(None)]
Nodes with only the heading returned OrgDate(None) for all SDC dates whereas nodes with multiple lines had the more precise object OrgDateScheduled(None)/... This PR harmonizes these cases by returning the more precise object in each case.
I also hardened the parsing tests by adding a type check (strict type equality between parsed and expected). The type check could be relaxed by checking that the parsed object is a subclass of the expected type.
With the PR, the example in #40 gives:
Solves issue #40