aviau / python-pass

For fun - I have decided to write pass in python
http://aviau.github.io/python-pass/
GNU General Public License v3.0
38 stars 16 forks source link

The git command forwards options and arguments as expected. Closes #8 #19

Closed prabi closed 5 years ago

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.2%) to 91.452% when pulling c4205697819896c6a429d83eeac930fc235aa8e9 on prabi:git_pass_opts into f437cf75a8806c59cf337755cfc0efa572d696cd on aviau:master.

aviau commented 5 years ago

Great! Can you think of a test that would verify this?

prabi commented 5 years ago

Sure. My favorite is pypass --PASSWORD_STORE_DIR a_test_vault git log -1 --pretty=%B which shows the last commit message (and two newlines) in a_test_vault if it's a git repo. It works when I use it in the terminal.

On the other hand, when I automate it with self.run_cli(['git', 'log', '-1', '--pretty=%B']) I get

WARNING: terminal is not fully functional
-  (press RETURN)

in the console. I think this is a limitation of click.testing.CliRunner.invoke. Do you have any idea how to overcome this?

aviau commented 5 years ago

Maybe that is because git log requires a terminal for the scrolling function.

Maybe another command would work?

prabi commented 5 years ago

Thank you for your great suggestion. I switched from the previous test case to git commit --amend -m sth which works flawlessly. I also used a slightly different implementation straight from click's advanced documentation.

aviau commented 5 years ago

Awesome! Thanks :tada: