covert-encryption / covert

An encryption format offering better security, performance and ease of use than PGP. File a bug if you found anything where we are worse than our competition, and we will fix it.
40 stars 10 forks source link

Added tests to test_cli #69

Closed rocketdey closed 2 years ago

codecov[bot] commented 2 years ago

Codecov Report

Merging #69 (163bed4) into main (1fb22f3) will increase coverage by 1.92%. The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   70.85%   72.78%   +1.92%     
==========================================
  Files          22       22              
  Lines        2131     2135       +4     
  Branches      499      502       +3     
==========================================
+ Hits         1510     1554      +44     
+ Misses        485      457      -28     
+ Partials      136      124      -12     
Impacted Files Coverage Δ
covert/cli.py 77.67% <69.44%> (+3.54%) :arrow_up:
covert/__main__.py 98.42% <100.00%> (+21.00%) :arrow_up:
covert/blockstream.py 81.31% <0.00%> (+1.51%) :arrow_up:

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 1fb22f3...163bed4. Read the comment docs.

rocketdey commented 2 years ago

Do you have any ideas how can I approach to this line to test it? https://github.com/covert-encryption/covert/blob/1fb22f36bb00d39d46505720b627fe15ecec775b/covert/__main__.py#L154-L155

covert-encryption commented 2 years ago

Do you have any ideas how can I approach to this line to test it?

https://github.com/covert-encryption/covert/blob/1fb22f36bb00d39d46505720b627fe15ecec775b/covert/__main__.py#L154-L155

You will need to use --passphrase (askpass) to trigger it. Test argparse() only so that Covert won't actually try to ask for a password.

covert-encryption commented 2 years ago

A nice increase in diff coverage and three real bugs found (and now fixed). Thanks. I'll merge this now, although some things remain to be tested.

Something for another PR: add test_clipboard CLI test function that uses mocker to enable isatty (the same way as some other CLI tests do, to cover the 📋 copied message) and also mocks the pyperclip copy and paste functions for armored text input/output.