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()
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())])
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())])