Skip to content

Commit

Permalink
Color
Browse files Browse the repository at this point in the history
  • Loading branch information
themanyfaceddemon committed Jul 28, 2024
1 parent 550e93e commit 4b91df7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Tests/Texture/TextureSystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@
import yaml
from PIL import Image

from Code.systems.texture_system import TextureSystem
from Code.systems.texture_system import *


class TestTextureSystem(unittest.TestCase):
def setUp(self):
self.test_dir = 'test_texture'
os.makedirs(self.test_dir, exist_ok=True)
self.compiled_dir = os.path.abspath(os.path.join(self.test_dir, 'compiled'))
os.makedirs(self.compiled_dir, exist_ok=True)

info_data = {
'Texture': [
Expand Down Expand Up @@ -113,7 +111,7 @@ def test_get_state_info(self):
def test_get_compiled_png(self):
path = self.test_dir
state = 'state1'
color = (255, 255, 255, 255)
color = Color(255, 255, 255, 255)

image = TextureSystem.get_image_recolor(path, state, color)
compiled_image = TextureSystem._get_compiled(path, state, color, is_gif=False)
Expand All @@ -123,7 +121,7 @@ def test_get_compiled_png(self):
def test_get_compiled_gif(self):
path = self.test_dir
state = 'state1'
color = (255, 255, 255, 255)
color = Color(255, 255, 255, 255)

gif_frames = TextureSystem.get_gif_recolor(path, state, color)
compiled_gif_frames = TextureSystem._get_compiled(path, state, color, is_gif=True)
Expand All @@ -135,7 +133,7 @@ def test_get_compiled_gif(self):
def test_get_image_recolor(self):
path = self.test_dir
state = 'state1'
color = (255, 0, 0, 255)
color = Color(255, 0, 0, 255)
image = TextureSystem.get_image_recolor(path, state, color)
expected_path = os.path.join(path, f'{state}_compiled_255_0_0_255.png')
self.assertTrue(os.path.exists(expected_path))
Expand All @@ -153,7 +151,7 @@ def test_get_image(self):
def test_get_gif_recolor(self):
path = self.test_dir
state = 'state2'
color = (255, 0, 0, 255)
color = Color(255, 0, 0, 255)
gif_frames = TextureSystem.get_gif_recolor(path, state, color)
expected_path = os.path.join(path, f'{state}_compiled_255_0_0_255.gif')
self.assertTrue(os.path.exists(expected_path))
Expand Down

0 comments on commit 4b91df7

Please sign in to comment.