tests: Move test files to other directory.

This commit is contained in:
Dylan Araps 2017-06-27 17:34:34 +10:00
parent 9e2fb01222
commit dbba94976c
8 changed files with 12 additions and 17 deletions

View File

@ -6,6 +6,6 @@ install:
- pip install flake8 pylint - pip install flake8 pylint
script: script:
- flake8 pywal setup.py - flake8 pywal tests setup.py
- pylint --ignore-imports=yes pywal setup.py - pylint --ignore-imports=yes pywal tests setup.py
- python setup.py test - python setup.py test

View File

@ -7,7 +7,7 @@ from pywal import util
# Import colors. # Import colors.
COLORS = util.read_file("tests/test_file") COLORS = util.read_file("tests/test_files/test_file")
class TestExportColors(unittest.TestCase): class TestExportColors(unittest.TestCase):
@ -16,7 +16,7 @@ class TestExportColors(unittest.TestCase):
def test_save_colors(self): def test_save_colors(self):
"""> Export colors to a file.""" """> Export colors to a file."""
tmp_file = pathlib.Path("/tmp/test_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") export_colors.save_colors(colors, tmp_file, "plain colors")
result = tmp_file.is_file() result = tmp_file.is_file()
self.assertTrue(result) self.assertTrue(result)

View File

@ -6,7 +6,7 @@ from pywal import util
# Import colors. # Import colors.
COLORS = util.read_file("tests/test_file") COLORS = util.read_file("tests/test_files/test_file")
class TestFormatColors(unittest.TestCase): class TestFormatColors(unittest.TestCase):

View File

@ -2,11 +2,6 @@
import unittest import unittest
from pywal import gen_colors from pywal import gen_colors
from pywal import util
# Import colors.
COLORS = util.read_file("tests/test_file")
class TestGenColors(unittest.TestCase): class TestGenColors(unittest.TestCase):
@ -14,13 +9,13 @@ class TestGenColors(unittest.TestCase):
def test_get_img(self): def test_get_img(self):
"""> Validate image file.""" """> Validate image file."""
result = gen_colors.get_image("tests/test.jpg") result = gen_colors.get_image("tests/test_files/test.jpg")
self.assertEqual(result, "tests/test.jpg") self.assertEqual(result, "tests/test_files/test.jpg")
def test_get_img_dir(self): def test_get_img_dir(self):
"""> Validate image directory.""" """> Validate image directory."""
result = gen_colors.get_image("tests") result = gen_colors.get_image("tests/test_files")
self.assertEqual(result, "tests/test.jpg") self.assertEqual(result, "tests/test_files/test.jpg")
if __name__ == "__main__": if __name__ == "__main__":

View File

@ -6,7 +6,7 @@ from pywal import util
# Import colors. # Import colors.
COLORS = util.read_file("tests/test_file") COLORS = util.read_file("tests/test_files/test_file")
class TestSetColors(unittest.TestCase): class TestSetColors(unittest.TestCase):

View File

@ -10,12 +10,12 @@ class TestUtil(unittest.TestCase):
def test_read_file_start(self): def test_read_file_start(self):
"""> Read colors from a file.""" """> 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") self.assertEqual(result[0], "#363442")
def test_read_file_end(self): def test_read_file_end(self):
"""> Read colors from a file.""" """> 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") self.assertEqual(result[15], "#C9CFD0")
def test_save_file(self): def test_save_file(self):