pytest-sftpserver icon indicating copy to clipboard operation
pytest-sftpserver copied to clipboard

Add stat times

Open WeatherGod opened this issue 8 years ago • 10 comments

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.

WeatherGod avatar Jun 09 '17 17:06 WeatherGod

Coverage Status

Coverage decreased (-0.9%) to 97.531% when pulling c8846bd6490e846881f9bd40cd602cece818eeaf on WeatherGod:add_stat_times into 547b1d364e2e94ee69f6731cffacb7c484aaecc3 on ulope:master.

coveralls avatar Jun 09 '17 18:06 coveralls

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().

WeatherGod avatar Jun 13 '17 16:06 WeatherGod

I rebased this PR onto master.

WeatherGod avatar Oct 12 '18 20:10 WeatherGod

Interesting that this fails on windows only, but not linux. The failures on windows basically show that the mtimes aren't getting updated.

WeatherGod avatar Oct 12 '18 20:10 WeatherGod

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 avatar Sep 16 '19 16:09 WeatherGod

@WeatherGod if you could that would be nice!

ulope avatar Sep 17 '19 10:09 ulope

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.

WeatherGod avatar Sep 17 '19 18:09 WeatherGod

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!

WeatherGod avatar Sep 17 '19 18:09 WeatherGod

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.

ulope avatar Sep 17 '19 18:09 ulope

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.

WeatherGod avatar Sep 17 '19 18:09 WeatherGod