You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been writing tests for a panflute filter, and thinking about how to best validate its output. While the "batteries included" functions like convert_text() are helpful for this task, I would like to directly compare elements. I suggest that we add a __eq__() comparison method to the pf.Element class that verifies that they are identical both in type and in terms of their parameters.
For example, comparing two pf.Doc elements would check that both have identical block sequences, metadata, format, and API version.
assertpf.Doc==pf.Doc# succeeds only if all parameters are identical
Thank you for your consideration!
The text was updated successfully, but these errors were encountered:
Just added this method. I also added a test suite, but haven't tested for correctness as much as I would have liked. So if you spot anything off definitely let me know!
I have been writing tests for a panflute filter, and thinking about how to best validate its output. While the "batteries included" functions like
convert_text()
are helpful for this task, I would like to directly compare elements. I suggest that we add a__eq__()
comparison method to thepf.Element
class that verifies that they are identical both in type and in terms of their parameters.For example, comparing two
pf.Doc
elements would check that both have identical block sequences, metadata, format, and API version.Thank you for your consideration!
The text was updated successfully, but these errors were encountered: