Beispiel #1
0
def test_app_lexer(patch):
    patch.object(Story, 'from_file')
    patch.init(Bundle)
    patch.object(Bundle, 'find_stories', return_value=['one.story'])
    result = App.lex('/path')
    Story.from_file.assert_called_with('one.story')
    assert result == {'one.story': Story.from_file().lex()}
Beispiel #2
0
def test_app_lexer(patch, read_story):
    patch.init(Parser)
    patch.object(Parser, 'lex')
    patch.object(App, 'get_stories', return_value=['one.story'])
    result = App.lex('/path')
    App.read_story.assert_called_with('one.story')
    Parser.lex.assert_called_with(App.read_story())
    assert result == {'one.story': Parser.lex()}