Files
MeshChatX/tests/backend/test_colour_utils.py
Sudo-Ivan 00b4290735
All checks were successful
CI / test-backend (push) Successful in 15s
CI / lint (push) Successful in 42s
CI / build-frontend (push) Successful in 9m35s
feat(tests): add comprehensive test suite for backend functionality, including database, configuration, and telemetry utilities
2026-01-02 19:41:05 -06:00

21 lines
596 B
Python

import pytest
from meshchatx.src.backend.colour_utils import ColourUtils
def test_hex_colour_to_byte_array():
# Test with # prefix
hex_val = "#FF00AA"
expected = bytes.fromhex("FF00AA")
assert ColourUtils.hex_colour_to_byte_array(hex_val) == expected
# Test without # prefix
hex_val = "00BBFF"
expected = bytes.fromhex("00BBFF")
assert ColourUtils.hex_colour_to_byte_array(hex_val) == expected
def test_hex_colour_to_byte_array_invalid():
# Test with invalid hex
with pytest.raises(ValueError):
ColourUtils.hex_colour_to_byte_array("#GG00AA")