Closed cs09g closed 9 years ago
Hello @cs09g. thanks for your contribution. This pull request is failing on CI:
=================================== FAILURES ===================================
______________ test_script_returns_zsh_script_when_zsh_shell_name ______________
mocker = <pytest_mock.MockFixture object at 0x7f0ba111e320>
def test_script_returns_zsh_script_when_zsh_shell_name(mocker):
shell_name = 'zsh'
config_path = '/tmp'
commands = ['add', 'remove', 'update', 'remove']
text = completion.script(shell_name=shell_name,
config_path=config_path,
commands=commands)
for line in completion.ZSH.split('\n')[:3]:
> assert line in text
E assert 'if [[ ! -o interactive ]]; then' in 'ZSH'
tests/test_completion.py:13: AssertionError
_____________ test_script_returns_bash_script_when_bash_shell_name _____________
mocker = <pytest_mock.MockFixture object at 0x7f0ba1100dd8>
def test_script_returns_bash_script_when_bash_shell_name(mocker):
shell_name = 'bash'
config_path = '/tmp'
commands = ['add', 'remove', 'update', 'remove']
text = completion.script(shell_name=shell_name,
config_path=config_path,
commands=commands)
for line in completion.BASH.split('\n')[:3]:
> assert line in text
E assert 'function _passpie()' in 'BASH'
Oh, sorry. Now, I understand that 'BASH' and 'ZSH' are global variables.
pair = {shell_name : globals()[shell_name.upper()]}
will be the solution.
variable SHELLS is used in somewhere?
If not, there will be better way to remove duplication of the code using SHELLS's index.