예제 #1
0
 def test_read_wallpaper(self):
     """> Read wallpaper from json file."""
     result = util.read_file_json("tests/test_files/test_file.json")
     self.assertEqual(result["wallpaper"], "5.png")
예제 #2
0
 def test_read_file_start(self):
     """> Read colors from a file."""
     result = util.read_file_json("tests/test_files/test_file.json")
     self.assertEqual(result["colors"]["color0"], "#1F211E")
예제 #3
0
 def test_read_file_end(self):
     """> Read colors from a file."""
     result = util.read_file_json("tests/test_files/test_file.json")
     self.assertEqual(result["colors"]["color15"], "#F5F1F4")
예제 #4
0
"""Test util functions."""
import unittest
import os

from pywal_16 import util


# Import colors.
COLORS = util.read_file_json("tests/test_files/test_file.json")


class TestUtil(unittest.TestCase):
    """Test the util functions."""

    def test_read_file(self):
        """> Read colors from a file."""
        result = util.read_file("tests/test_files/test_file")
        self.assertEqual(result[0], "/home/dylan/Pictures/Wallpapers/1.jpg")

    def test_read_file_start(self):
        """> Read colors from a file."""
        result = util.read_file_json("tests/test_files/test_file.json")
        self.assertEqual(result["colors"]["color0"], "#1F211E")

    def test_read_file_end(self):
        """> Read colors from a file."""
        result = util.read_file_json("tests/test_files/test_file.json")
        self.assertEqual(result["colors"]["color15"], "#F5F1F4")

    def test_read_wallpaper(self):
        """> Read wallpaper from json file."""