Closed SilvioC2C closed 7 months ago
this method seems not tied at all to the class: I would make it a simple function to call from everywhere w/o having to inherit this class (which btw has tests and will be inherited as well).
I'll create an external function that can be safely imported by other modules, and then the class's method will simply redirect to it
@simahawk mind reviewing?
/ocabot merge patch
This PR looks fantastic, let's merge it! Prepared branch 16.0-ocabot-merge-pr-676-by-simahawk-bump-patch, awaiting test results.
Congratulations, your PR was merged at 8218245c544df2edf145d116d3795db695c8243a. Thanks a lot for contributing to OCA. ❤️
This refactoring will allow using
TestParser._do_parse_test()
method for subclasses defined in inheriting modules.This way, if the new module defines new files in other paths than
account_statement_import_camt/test_files/
, subclasses ofTestParser
will still be able to use the_do_parse_test()
method for imports and checks.Moreover, a custom value can now be defined for the acceptable differing lines number between inputfile and goldenfile.
It will also maintain backward compatibility with the current usage of the method (ie: using only a filename with the assumption of finding it in
account_statement_import_camt/test_files/
).NB: methods are now defined outside of
TestParser
to allow importing them directly, instead of inheriting fromTestParser
.