Skip to content

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

Merged
merged 1 commit into from
Sep 9, 2021
Merged

fix(test): unifiy test for RF<4 and RF>=4 #30

merged 1 commit into from
Sep 9, 2021

Conversation

matejc
Copy link
Contributor

@matejc matejc commented Sep 8, 2021

No description provided.

Copy link
Contributor

@Tattoo Tattoo left a 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 :)

Comment on lines 58 to 62
exampleTree = ElementTree.parse(example)
exampleRoot = exampleTree.getroot()

actualTree = ElementTree.parse(actual)
actualRoot = actualTree.getroot()
Copy link
Contributor

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:

Suggested change
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()

Comment on lines 66 to 68
exampleStat = exampleRoot.find(
'./statistics/total//stat[.="All Tests"]')
actualStat = actualRoot.find('./statistics/total//stat[.="All Tests"]')
Copy link
Contributor

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:

Suggested change
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 😠

Copy link
Contributor

@Tattoo Tattoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matejc matejc merged commit 4cbc4e9 into master Sep 9, 2021
@matejc matejc deleted the fix/rf4-test branch September 9, 2021 07:06
@Tattoo Tattoo mentioned this pull request Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants