Skip to content

Commit

Permalink
wip: profiler directory implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fgtrzah committed Oct 24, 2023
1 parent 43bd2a0 commit c41a0a2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Empty file modified scripts/dev.sh
100644 → 100755
Empty file.
Binary file removed tests/data/grainyZoo.png
Binary file not shown.
Binary file removed tests/data/zoo_tiny.png
Binary file not shown.
20 changes: 17 additions & 3 deletions tests/test_plucktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ def test_pluck_main_colors():
assert list(r["colors"]) == e, flash_assert_msg(r, e)


def test_rendering():
def test_rendering(path = None):
import sys

try:
vec = path_to_vec("tests/data/01.png")
vec = path_to_vec(path or "tests/data/01.png")
conf = pluck_colors(vec)
theme = pluck_theme_from_colors(conf)
rgba_colors_from_theme = theme.get("rawrgba")
Expand All @@ -105,16 +105,30 @@ def test_rendering():
for c in rgba_colors_from_theme:
r, g, b, _ = list(c)
res += f"\033[48;2;{r};{g};{b}m rgba{c} \033[0m"
print(res)
assert res
except ValueError:
sys.exit(2)
print(path)
sys.exit()


def test_bulk():
import os

for fp in os.listdir('tests/data'):
if ".gif" not in fp:
fsp = f"tests/data/{fp}"
test_rendering(fsp)

assert True


def test_main():
test_path_to_vec()
test_pluck_colors()
test_pluck_main_colors()
test_rendering()
test_bulk()


if __name__ == "__main__":
Expand Down

0 comments on commit c41a0a2

Please sign in to comment.