forked from importers/git-importer
Import the fixtures into the test database for queries
This commit is contained in:
26
tests/tree_test.py
Normal file
26
tests/tree_test.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import os
|
||||
import unittest
|
||||
from pprint import pprint
|
||||
|
||||
import yaml
|
||||
|
||||
from lib.db import DB
|
||||
from lib.db_revision import DBRevision
|
||||
|
||||
|
||||
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):
|
||||
factory_revisions = DBRevision.all_revisions(self.db, "openSUSE:Factory", "zsh")
|
||||
pprint(sorted(factory_revisions))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
Reference in New Issue
Block a user