test: test cases for kata RGB to Hex
This commit is contained in:
parent
d4b184e993
commit
24eee51297
16
tests/test_codewars/test_rgb_2_hex.py
Normal file
16
tests/test_codewars/test_rgb_2_hex.py
Normal file
@ -0,0 +1,16 @@
|
||||
from src.codewars.kata_rgb_2_hex import rgb
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("r", "g", "b", "expected"),
|
||||
[
|
||||
(0, 0, 0, "000000"),
|
||||
(1, 2, 3, "010203"),
|
||||
(255, 255, 255, "FFFFFF"),
|
||||
(254, 253, 252, "FEFDFC"),
|
||||
(-20, 275, 125, "00FF7D"),
|
||||
],
|
||||
)
|
||||
def test_rgb_2_hex(r, g, b, expected):
|
||||
assert rgb(r, g, b) == expected
|
||||
Loading…
x
Reference in New Issue
Block a user