From dbba94976cee6ab155ab6fc1bcf3344c6228c516 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:34:34 +1000 Subject: tests: Move test files to other directory. --- .travis.yml | 4 ++-- tests/test.jpg | 0 tests/test_export_colors.py | 4 ++-- tests/test_file | 16 ---------------- tests/test_files/test.jpg | 0 tests/test_files/test_file | 16 ++++++++++++++++ tests/test_format_colors.py | 2 +- tests/test_gen_colors.py | 13 ++++--------- tests/test_set_colors.py | 2 +- tests/test_util.py | 4 ++-- 10 files changed, 28 insertions(+), 33 deletions(-) delete mode 100644 tests/test.jpg delete mode 100644 tests/test_file create mode 100644 tests/test_files/test.jpg create mode 100644 tests/test_files/test_file diff --git a/.travis.yml b/.travis.yml index 464bdf8..f3f35ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ install: - pip install flake8 pylint script: - - flake8 pywal setup.py - - pylint --ignore-imports=yes pywal setup.py + - flake8 pywal tests setup.py + - pylint --ignore-imports=yes pywal tests setup.py - python setup.py test diff --git a/tests/test.jpg b/tests/test.jpg deleted file mode 100644 index e69de29..0000000 diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py index 5680dfc..09265c6 100755 --- a/tests/test_export_colors.py +++ b/tests/test_export_colors.py @@ -7,7 +7,7 @@ from pywal import util # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestExportColors(unittest.TestCase): @@ -16,7 +16,7 @@ class TestExportColors(unittest.TestCase): def test_save_colors(self): """> Export colors to a file.""" tmp_file = pathlib.Path("/tmp/test_file") - colors = util.read_file("tests/test_file") + colors = util.read_file("tests/test_files/test_file") export_colors.save_colors(colors, tmp_file, "plain colors") result = tmp_file.is_file() self.assertTrue(result) diff --git a/tests/test_file b/tests/test_file deleted file mode 100644 index 30eeeaa..0000000 --- a/tests/test_file +++ /dev/null @@ -1,16 +0,0 @@ -#363442 -#99A3B1 -#C5BDB6 -#98AEC2 -#A8B9C6 -#96C4CF -#B7C5CC -#C9CFD0 -#999999 -#99A3B1 -#C5BDB6 -#98AEC2 -#A8B9C6 -#96C4CF -#B7C5CC -#C9CFD0 diff --git a/tests/test_files/test.jpg b/tests/test_files/test.jpg new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_files/test_file b/tests/test_files/test_file new file mode 100644 index 0000000..30eeeaa --- /dev/null +++ b/tests/test_files/test_file @@ -0,0 +1,16 @@ +#363442 +#99A3B1 +#C5BDB6 +#98AEC2 +#A8B9C6 +#96C4CF +#B7C5CC +#C9CFD0 +#999999 +#99A3B1 +#C5BDB6 +#98AEC2 +#A8B9C6 +#96C4CF +#B7C5CC +#C9CFD0 diff --git a/tests/test_format_colors.py b/tests/test_format_colors.py index ecee336..63c1ce2 100755 --- a/tests/test_format_colors.py +++ b/tests/test_format_colors.py @@ -6,7 +6,7 @@ from pywal import util # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestFormatColors(unittest.TestCase): diff --git a/tests/test_gen_colors.py b/tests/test_gen_colors.py index e9fa5e2..8bab35a 100755 --- a/tests/test_gen_colors.py +++ b/tests/test_gen_colors.py @@ -2,11 +2,6 @@ import unittest from pywal import gen_colors -from pywal import util - - -# Import colors. -COLORS = util.read_file("tests/test_file") class TestGenColors(unittest.TestCase): @@ -14,13 +9,13 @@ class TestGenColors(unittest.TestCase): def test_get_img(self): """> Validate image file.""" - result = gen_colors.get_image("tests/test.jpg") - self.assertEqual(result, "tests/test.jpg") + result = gen_colors.get_image("tests/test_files/test.jpg") + self.assertEqual(result, "tests/test_files/test.jpg") def test_get_img_dir(self): """> Validate image directory.""" - result = gen_colors.get_image("tests") - self.assertEqual(result, "tests/test.jpg") + result = gen_colors.get_image("tests/test_files") + self.assertEqual(result, "tests/test_files/test.jpg") if __name__ == "__main__": diff --git a/tests/test_set_colors.py b/tests/test_set_colors.py index 3d3d800..43c6aed 100755 --- a/tests/test_set_colors.py +++ b/tests/test_set_colors.py @@ -6,7 +6,7 @@ from pywal import util # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestSetColors(unittest.TestCase): diff --git a/tests/test_util.py b/tests/test_util.py index 6aeef9b..b1a396b 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -10,12 +10,12 @@ class TestUtil(unittest.TestCase): def test_read_file_start(self): """> Read colors from a file.""" - result = util.read_file("tests/test_file") + result = util.read_file("tests/test_files/test_file") self.assertEqual(result[0], "#363442") def test_read_file_end(self): """> Read colors from a file.""" - result = util.read_file("tests/test_file") + result = util.read_file("tests/test_files/test_file") self.assertEqual(result[15], "#C9CFD0") def test_save_file(self): -- cgit v1.2.3