Split out Flat generator to be able to test it

This commit is contained in:
Stephan Kulow
2022-11-02 07:20:53 +01:00
parent c94d13d74e
commit 4ff9b9771a
11 changed files with 421 additions and 61 deletions

View File

@@ -2,6 +2,7 @@ from typing import Dict
from xmlrpc.client import Boolean
from lib.db_revision import DBRevision
from lib.flat_walker import FlatTreeWalker
from lib.request import Request
@@ -50,6 +51,12 @@ class TreeNode:
def print(self):
self.walk(PrintWalker())
def as_flat_list(self):
"""Return the tree as git commits to do"""
ftw = FlatTreeWalker()
self.walk(ftw)
return ftw.flats
def as_list(self):
"""Return a list for test cases"""
node = self