-
Notifications
You must be signed in to change notification settings - Fork 8
fix(test): unifiy test for RF<4 and RF>=4 #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just few things to tidy this up :)
exampleTree = ElementTree.parse(example) | ||
exampleRoot = exampleTree.getroot() | ||
|
||
actualTree = ElementTree.parse(actual) | ||
actualRoot = actualTree.getroot() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose we do not introduce variables when they are not used:
exampleTree = ElementTree.parse(example) | |
exampleRoot = exampleTree.getroot() | |
actualTree = ElementTree.parse(actual) | |
actualRoot = actualTree.getroot() | |
example_xml = ElementTree.parse(example).getroot() | |
produced_xml = ElementTree.parse(actual).getroot() |
exampleStat = exampleRoot.find( | ||
'./statistics/total//stat[.="All Tests"]') | ||
actualStat = actualRoot.find('./statistics/total//stat[.="All Tests"]') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not repeat the XPath pattern as it's the same for both:
exampleStat = exampleRoot.find( | |
'./statistics/total//stat[.="All Tests"]') | |
actualStat = actualRoot.find('./statistics/total//stat[.="All Tests"]') | |
all_tests_stat_block = './statistics/total//stat[.="All Tests"]' | |
expected_stat = exampleRoot.find(all_tests_stat_block) | |
actual_stat = actualRoot.find(all_tests_stat_block) |
Also, I think most of the project, we use snake_case
rather than camelCase
. unittest
's asserts are the exception, which is supremely annoying 😠
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.