From d98be353ecd5deff97804312ec798fb227adfbc1 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 9 Aug 2017 11:22:51 +1000 Subject: general: Make pywal compatible with python 3.5 --- tests/test_util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tests/test_util.py') diff --git a/tests/test_util.py b/tests/test_util.py index bc551ef..aae0356 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -49,10 +49,9 @@ class TestUtil(unittest.TestCase): def test_create_dir(self): """> Create a directory.""" - tmp_dir = pathlib.Path("/tmp/test_dir") + tmp_dir = "/tmp/test_dir" util.create_dir(tmp_dir) - result = tmp_dir.is_dir() - self.assertTrue(result) + self.assertTrue(os.path.isdir(tmp_dir)) os.rmdir(tmp_dir) def test_hex_to_rgb_black(self): -- cgit v1.2.3 From c61960722d28373a4668814d996a248819e220c0 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 10 Aug 2017 09:23:50 +1000 Subject: general: Remove all pathlib usage --- tests/test_util.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'tests/test_util.py') diff --git a/tests/test_util.py b/tests/test_util.py index aae0356..79b6b96 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,7 +1,6 @@ """Test util functions.""" import unittest import os -import pathlib from pywal import util @@ -35,16 +34,16 @@ class TestUtil(unittest.TestCase): def test_save_file(self): """> Save colors to a file.""" - tmp_file = pathlib.Path("/tmp/test_file") + tmp_file = "/tmp/test_file" util.save_file("Hello, world", tmp_file) - result = tmp_file.is_file() + result = os.path.isfile(tmp_file) self.assertTrue(result) def test_save_file_json(self): """> Save colors to a file.""" - tmp_file = pathlib.Path("/tmp/test_file.json") + tmp_file = "/tmp/test_file.json" util.save_file_json(COLORS, tmp_file) - result = tmp_file.is_file() + result = os.path.isfile(tmp_file) self.assertTrue(result) def test_create_dir(self): -- cgit v1.2.3