diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-08-07 14:13:49 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-08-07 14:13:49 +0200 |
commit | 9e224909f59efc1b8e52b0f07e7d25b5130ebd75 (patch) | |
tree | fe5f632eaba7f31f35283fbb47cb447abef25ace | |
parent | 75c8bf5d74a563db9e849e102cf1fcc5f9677098 (diff) | |
download | psutil-9e224909f59efc1b8e52b0f07e7d25b5130ebd75.tar.gz |
add test to make sure all example scripts are executable
-rwxr-xr-x[-rw-r--r--] | examples/ifconfig.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/ps.py | 0 | ||||
-rwxr-xr-x[-rw-r--r--] | examples/pstree.py | 0 | ||||
-rw-r--r-- | test/test_psutil.py | 7 |
4 files changed, 7 insertions, 0 deletions
diff --git a/examples/ifconfig.py b/examples/ifconfig.py index 1f1ee985..1f1ee985 100644..100755 --- a/examples/ifconfig.py +++ b/examples/ifconfig.py diff --git a/examples/ps.py b/examples/ps.py index 2b67bd18..2b67bd18 100644..100755 --- a/examples/ps.py +++ b/examples/ps.py diff --git a/examples/pstree.py b/examples/pstree.py index 1bf8c9c0..1bf8c9c0 100644..100755 --- a/examples/pstree.py +++ b/examples/pstree.py diff --git a/test/test_psutil.py b/test/test_psutil.py index 98784861..04fd092f 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -3005,6 +3005,13 @@ class TestExampleScripts(unittest.TestCase): self.fail('no test defined for %r script' % os.path.join(EXAMPLES_DIR, name)) + def test_executable(self): + for name in os.listdir(EXAMPLES_DIR): + if name.endswith('.py'): + path = os.path.join(EXAMPLES_DIR, name) + if not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]: + self.fail('%r is not executable' % path) + def test_disk_usage(self): self.assert_stdout('disk_usage.py') |