def test_get_name_when_params_is_empty(): key = '' item = '' serializer = TrelloCardSerializer() with pytest.raises(IndexError): serializer.get_name(key, item)
def test_get_name_when_receive_params(): key = 'candy.feature' item = '''\nFeature: example\n\nSmall description\n\n @trello-1234\n\n\n Scenario:\n\n Given i like to boogie\n\n\n''' serializer = TrelloCardSerializer() expected_result = '[candy] example' result = serializer.get_name(key, item) assert result == expected_result