def test_storyerror_highlight(patch, storyerror, error):
    """
    Ensures StoryError.highlight produces the correct text.
    """
    patch.many(StoryError, ['get_line', 'int_line', 'symbols'])
    error.column = '1'
    result = storyerror.highlight()
    highlight = StoryError.symbols()
    args = (storyerror.int_line(), StoryError.get_line().replace(), highlight)
    assert result == '{}|    {}\n{}'.format(*args)
Exemple #2
0
def test_storyerror_highlight(patch, storyerror, error):
    """
    Ensures StoryError.highlight produces the correct text.
    """
    patch.many(StoryError, ["get_line", "int_line", "symbols"])
    error.column = "1"
    result = storyerror.highlight()
    highlight = StoryError.symbols()
    args = (storyerror.int_line(), StoryError.get_line().replace(), highlight)
    assert result == "{}|    {}\n{}".format(*args)