Я хочу понять, что я здесь делаю неправильно.
from enum import Enum, auto
class colors(Enum):
red= auto()
green= auto()
yellow= auto()
Это мой класс.
def is_first(self):
return self is not colors.red
Моя первая функция.
def second(self):
if self is colors.red:
return ''
elif self is green:
return 'second_type'
elif self is yellow:
return 'third_type'
Что я делаю не так в тестировании, мне нужно, чтобы они все прошли.
@pytest.mark.parametrize('input_str, expected_result',
[('aa', False)])
def test_is_first(input_str, expected_result):
assert is_first(input_str) is expected_result
и для моей второй функции
@pytest.mark.parametrize('input_str, expected_result',
[('', True),
('second_type', True),
('third_type', True),
('aa', False)])
def test_second(input_str, expected_result):
assert second(input_str) is expected_result