17 lines
372 B
Python
17 lines
372 B
Python
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
|