From 1002f60be172dc4411e77527c15bfeeaefd5892e Mon Sep 17 00:00:00 2001 From: Chris Caron Date: Mon, 12 Mar 2018 22:22:26 -0400 Subject: [PATCH] skip tests that fail when ran as root user --- test/test_api.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/test_api.py b/test/test_api.py index bbaa6a53..bf851cbb 100644 --- a/test/test_api.py +++ b/test/test_api.py @@ -2,7 +2,7 @@ # # Apprise and AppriseAsset Unit Tests # -# Copyright (C) 2017 Chris Caron +# Copyright (C) 2017-2018 Chris Caron # # This file is part of apprise. # @@ -19,6 +19,7 @@ from __future__ import print_function from __future__ import unicode_literals from os import chmod +from os import getuid from os.path import dirname from apprise import Apprise from apprise import AppriseAsset @@ -28,6 +29,7 @@ from apprise import NotifyType from apprise import NotifyFormat from apprise import NotifyImageSize from apprise.Apprise import __load_matrix +import pytest def test_apprise(): @@ -378,6 +380,11 @@ def test_apprise_asset(tmpdir): # If we make the file un-readable however, we won't be able to read it # This test is just showing that we won't throw an exception + if getuid() == 0: + # Root always over-rides 0x000 permission settings making the below + # tests futile + pytest.skip('The Root user can not run file permission tests.') + chmod(dirname(sub.strpath), 0o000) assert(a.image_raw(NotifyType.INFO, NotifyImageSize.XY_256) is None)