コード例 #1
0
ファイル: Faketree.py プロジェクト: wilzbach/storyscript
def test_faketree_get_line(patch, tree, fake_tree):
    """
    Ensures FakeTree.get_line can get a new line
    """
    patch.object(FakeTree, "line")
    result = fake_tree.get_line(tree)
    assert result == FakeTree.line()
コード例 #2
0
ファイル: Faketree.py プロジェクト: wilzbach/storyscript
def test_faketree_path(patch, fake_tree):
    patch.object(FakeTree, "line")
    FakeTree.line.return_value = "fake.line"
    result = fake_tree.path()
    name = "__p-fake.line"
    assert result == Tree("path", [Token("NAME", name, line=FakeTree.line())])
コード例 #3
0
ファイル: Faketree.py プロジェクト: rohit121/storyscript
def test_faketree_path(patch, fake_tree):
    patch.object(FakeTree, 'line')
    FakeTree.line.return_value = 'fake.line'
    result = fake_tree.path()
    name = '__p-fake.line'
    assert result == Tree('path', [Token('NAME', name, line=FakeTree.line())])