Exemple #1
0
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()
Exemple #2
0
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())])
Exemple #3
0
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())])