pytest-sftpserver
pytest-sftpserver copied to clipboard
Add stat times
sftpserver should now manage atime and mtime of the "files", and operating on the filesystem should get you proper atime/mtime modification behavior.
Needed for writing tests for an internal package of my employer that checks the lateness of product deliveries.
I had to mark two old test to skip because they no longer work, but I am not convinced the tests were correct before.
Coverage decreased (-0.9%) to 97.531% when pulling c8846bd6490e846881f9bd40cd602cece818eeaf on WeatherGod:add_stat_times into 547b1d364e2e94ee69f6731cffacb7c484aaecc3 on ulope:master.
Travis failure is due to the lack of py26 on the travis image, and the decrease in coverage is mostly due to me marking two tests for skipping because I couldn't figure out if they were right or not.
This PR merges cleanly with #11, but will need one line modified after the merge in interface.VirtualSFTPHandle.write().
I rebased this PR onto master.
Interesting that this fails on windows only, but not linux. The failures on windows basically show that the mtimes aren't getting updated.
Let me know if you'd like me to try rebasing this branch to take into account all of the recent changes. I did it once before, so maybe I can find that branch somewhere...
@WeatherGod if you could that would be nice!
rebased and forced-pushed. Also addressed the comment I made about the additional line of code that needed merging.
Don't forget that my changes also includes marking two existing tests for skipping, as I think they are wrong, but not being the original author, I can't be certain.
seriously, a simple, small, recursive function is considered "too complex", and for a concept that nearly any programmer should understand (recursive listing of a directory structure...)? Bah!
Thanks!
Don't forget that my changes also includes marking two existing tests for skipping, as I think they are wrong, but not being the original author, I can't be certain.
I’ll have a look.
As for the code climate warnings, I agree threat they are a bit over the top. The thresholds seem to be configurable. I’ll see if I can chill it out a bit. But it’s not a mandatory check anyway.
Weird, this is still showing the same problem on Windows that I noticed before where the mtimes aren't getting updated. This problem doesn't happen on my linux systems. I am not sure why this would only impact windows, unless maybe paramiko is doing something different on windows than on linux? I am not familiar enough with windows to know.