-
Notifications
You must be signed in to change notification settings - Fork 383
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
test(scp): Add unit tests for getting remote files #1244
Conversation
5322a52
to
1302eb3
Compare
I think this should be tested within |
1302eb3
to
ccae0ad
Compare
Moved to |
You can call |
This doesn't seem to work, the diff doesn't look at the saved variables, it just uses |
How have you checked that it doesn't seem to work? I now tried that, but it works.
The saved variables are restored by |
Ah I managed it, I was trying to save the variable after it was changed, which in hindsight obviously doesn't make sense :) |
ccae0ad
to
4485de6
Compare
1b29aa5
to
3f355a4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest seems good. The mock ssh
is of course not a complete implementation of the ssh argument parsing, but we can at least explain its limited behavior.
This tests the current behaviour of the xfunc_scp_compgen_remote_files function, including escaping, by introducing a fixture to mock ssh invocation on the local host.
3f355a4
to
b6e9900
Compare
Since there doesn't seem to be any unit tests for xfuncs, I'm not sure if the naming here makes sense, or if I should make some more directories, for example a
unit/xfunc
orfixtures/xfunc
?I did this since there seems to be a lot of issues with this function, as seen in #910 and #765 (comment)
This should be a first good step to make fixing the issues easier IMO.