Skip to content
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

Improve Terminal #53

Merged
merged 6 commits into from Apr 9, 2020
Merged

Improve Terminal #53

merged 6 commits into from Apr 9, 2020

Conversation

bjoernricks
Copy link
Member

@bjoernricks bjoernricks commented Apr 7, 2020

  • Ensure less issues with calculating a terminal width
  • Add a single place to query the terminal width
  • Improve readability and reliability of the terminal tests

Checklist:

Using rope allows for easier refactoring like renaming variables.
The docs of os.get_terminal_size refer to using shutil instead.
If the terminal size couldn't be detected fall back to 80x24. This
should ensure always having a valid terminal size.
There is no need to store the terminal with in an instance variable.
Therefore also refactor _check_size into a static method of the Terminal
class.
Mock the terminal width function to always return a valid value.
@codecov
Copy link

codecov bot commented Apr 7, 2020

Codecov Report

Merging #53 into master will decrease coverage by 0.00%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   51.63%   51.63%   -0.01%     
==========================================
  Files          14       14              
  Lines         732      734       +2     
==========================================
+ Hits          378      379       +1     
- Misses        354      355       +1     
Impacted Files Coverage Δ
autohooks/terminal.py 91.30% <80.00%> (-1.88%) ⬇️

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 43602d2...c9d98ec. Read the comment docs.

@bjoernricks bjoernricks marked this pull request as ready for review April 7, 2020 16:14
@bjoernricks bjoernricks merged commit c2b9192 into greenbone:master Apr 9, 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.

None yet

2 participants