diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-02-03 18:05:47 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-02-04 04:44:38 +0100 |
commit | 4763341ea11c9e33f8d8f0f112659fae5bc74aa9 (patch) | |
tree | 15254277360a41a9e2df9575d4f4c611167e55fa /test/pacman/pmrule.py | |
parent | 1601532a53b3b668b0946400bb2c68ca25f80c72 (diff) | |
download | pacman-4763341ea11c9e33f8d8f0f112659fae5bc74aa9.tar.gz pacman-4763341ea11c9e33f8d8f0f112659fae5bc74aa9.tar.xz |
pmrule: add FILE_EMPTY rule
Succeeds if the specified path is a file and is empty.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/pmrule.py')
-rw-r--r-- | test/pacman/pmrule.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/pacman/pmrule.py b/test/pacman/pmrule.py index ba94ab8c..a91741be 100644 --- a/test/pacman/pmrule.py +++ b/test/pacman/pmrule.py @@ -112,6 +112,10 @@ class pmrule(object): if case == "EXIST": if not os.path.isfile(filename): success = 0 + elif case == "EMPTY": + if not (os.path.isfile(filename) + and os.path.getsize(filename) == 0): + success = 0 elif case == "MODIFIED": for f in test.files: if f.name == key: |