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(uuid, 'uuid4') patch.object(FakeTree, 'line') result = fake_tree.path() name = '${}'.format(uuid.uuid4().hex[:8]) 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())])