def test__is_if_condition_true(patch, story): line = { 'args': ['my_condition'] } patch.object(story, 'resolve', return_value='condition_result') assert Lexicon._is_if_condition_true(story, line) == 'condition_result' story.resolve.assert_called_with('my_condition', encode=False)
def test__is_if_condition_true_complex(patch, story): line = {'args': ['my_condition', 'my_condition_2']} with pytest.raises(StoryscriptError): Lexicon._is_if_condition_true(story, line)