Split out Flat generator to be able to test it
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user