forked from adamm/git-importer
26 lines
624 B
Python
26 lines
624 B
Python
import os
|
|
import unittest
|
|
|
|
import yaml
|
|
|
|
from lib.db import DB
|
|
from lib.db_revision import DBRevision
|
|
from lib.tree_builder import TreeBuilder
|
|
|
|
|
|
class TestTreeMethods(unittest.TestCase):
|
|
def setUp(self):
|
|
self.db = DB(section="test")
|
|
path = os.path.join(os.path.dirname(__file__), "fixtures/zsh-data.yaml")
|
|
with open(path, "r") as f:
|
|
zsh_data = yaml.safe_load(f)
|
|
for rev in zsh_data["revisions"]:
|
|
DBRevision.import_fixture_dict(self.db, rev)
|
|
|
|
def test_create_tree(self):
|
|
TreeBuilder(self.db).build("zsh")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|