fabric/fabric — pull request #1047 by alb-i986 (2013-12-26 23:43:56+00:00)
Title: Adding task contrib.files.test_file wrapping the `test` Unix command (and a bit more)

With `test_file` Fabric finally features a generic task for testing properties on a file, supporting any (unary) tests that the Unix `test` command supports (*).

Moreover:
- refactoring `is_link` and `exists`: now they just pass on to `test_file`
- adding a few common test tasks: `is_readable`, `is_writable`, `is_executable`.

Patch made by leveraging code from pulls #925 (refactorings to `is_link` by @bitprophet) and #928 (a bug fix to the #925 refactorings), so thanks @bitprophet and @apbarrero.

Soon I am going to add some integration tests.

Hope everything's OK.
Let me know

AS

(*) Not sure if the unary operators of `test` are universal to every platform for which Fabric is built. If it isn't so, it's possible to restrict the allowed operators through the `op_pattern` variable (now holding [bcdefgGhkLOprsSuwx], filled up with what I found in `man test` on my Debian PC)