Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

vipulchhabra99
Copy link
Contributor

The popper scaffold test has been updated using click unit testing.

@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #807 into master will increase coverage by 0.48%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #807      +/-   ##
==========================================
+ Coverage   92.00%   92.48%   +0.48%     
==========================================
  Files          20       23       +3     
  Lines        1751     1837      +86     
==========================================
+ Hits         1611     1699      +88     
+ Misses        140      138       -2     
Impacted Files Coverage Δ
cli/test/test_scaffold.py 100.00% <100.00%> (ø)
cli/popper/scm.py 85.52% <0.00%> (-1.32%) ⬇️
cli/test/test_scm.py 97.40% <0.00%> (ø)
cli/test/test_common.py 100.00% <0.00%> (ø)
cli/test/test_config.py 100.00% <0.00%> (ø)
cli/popper/commands/cmd_run.py 82.00% <0.00%> (ø)
cli/popper/commands/cmd_scaffold.py 92.30% <0.00%> (ø)
cli/popper/runner_host.py 90.68% <0.00%> (+0.36%) ⬆️
cli/popper/parser.py 91.77% <0.00%> (+3.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d91d11d...51e2451. Read the comment docs.

Copy link
Collaborator

@ivotron ivotron left a comment

Choose a reason for hiding this comment

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

thanks @vipulchhabra99 ! Please take a look at the comments


repo = self.mk_repo()
runner = CliRunner()
file_loc = repo.working_dir+'/wf.yml'
Copy link
Collaborator

Choose a reason for hiding this comment

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

mk_repo creates a git repo. In this case, we don't really need one, so we can instead use tempfile:

wf_dir = tempfile.mkdtemp()
file_loc = f'{wf_dir}/wf.yml'

BTW, we can use f-strings here as well as shown above, in order to keep it consistent with the rest of the codebase

result = runner.invoke(run.cli, ['-f', file_loc])
self.assertEqual(result.exit_code, 0)

self.assertTrue(len(test_logger.output))
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be indented within the with statement, as the test_logger variable is only valid in this scope

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can also inspect the content of the output to ensure that it ran as it should

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I inspect the number of steps it ran because the other output is very lengthy?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, that works fine. we only need to solve the pep8 issues that might arise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@pep8speaks
Copy link

pep8speaks commented Apr 20, 2020

Hello @vipulchhabra99! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-04-20 04:46:06 UTC

@ivotron ivotron merged commit 5ed10c1 into getpopper:master Apr 20, 2020
@ivotron
Copy link
Collaborator

ivotron commented Apr 20, 2020

thanks a lot @vipulchhabra99 !

ivotron pushed a commit that referenced this pull request May 24, 2020
ivotron pushed a commit that referenced this pull request May 25, 2020
ivotron pushed a commit that referenced this pull request May 25, 2020
ivotron pushed a commit that referenced this pull request May 25, 2020
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.

3 participants