コード例 #1
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)
コード例 #2
0
ファイル: StoryError.py プロジェクト: wilzbach/storyscript
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)