forked from adamm/git-importer
Split out Flat generator to be able to test it
This commit is contained in:
@@ -31,6 +31,20 @@ class TestTreeMethods(unittest.TestCase):
|
||||
with open(path, "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
self.assertEqual(data, revisions.as_list())
|
||||
|
||||
# verify flat lists
|
||||
path = os.path.join(
|
||||
os.path.dirname(__file__), f"fixtures/{package}-expected-list.yaml"
|
||||
)
|
||||
flat_list = [str(x) for x in revisions.as_flat_list()]
|
||||
if os.getenv("REGENERATE_DATA"):
|
||||
with open(path, "w") as f:
|
||||
yaml.dump(flat_list, f)
|
||||
|
||||
with open(path, "r") as f:
|
||||
data = yaml.safe_load(f)
|
||||
self.assertEqual(data, flat_list)
|
||||
|
||||
self.db.conn.rollback()
|
||||
|
||||
def test_zsh_tree(self):
|
||||
|
Reference in New Issue
Block a user