From 86ed02bfc59023fa38c8d1780234f3d2f75a085d Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 23 Jul 2017 20:13:43 +1000 Subject: tests: Added a test for disown() --- tests/test_util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_util.py b/tests/test_util.py index 841c242..66a6b7e 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,5 +1,6 @@ """Test util functions.""" import unittest +import os import pathlib from pywal import util @@ -58,6 +59,7 @@ class TestUtil(unittest.TestCase): util.create_dir(tmp_dir) result = tmp_dir.is_dir() self.assertTrue(result) + os.rmdir(tmp_dir) def test_hex_to_rgb_black(self): """> Convert #000000 to RGB.""" @@ -79,6 +81,14 @@ class TestUtil(unittest.TestCase): result = util.hex_to_xrgba("#98AEC2") self.assertEqual(result, "98/ae/c2/ff") + def test_disown(self): + """> Test disown command.""" + test_file = pathlib.Path("/tmp/wal-test-disown") + util.disown("touch", test_file) + result = test_file.is_file() + self.assertTrue(result) + os.remove(test_file) + if __name__ == "__main__": unittest.main() -- cgit v1.2.3