From d7a6836d7a97b456ec4a29f4ee20b98256c65dd7 Mon Sep 17 00:00:00 2001 From: Priit Laes Date: Tue, 3 Aug 2010 22:45:52 +0300 Subject: Added tests for pkg devs --- grumpy/testsuite/pkgmodel.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/grumpy/testsuite/pkgmodel.py b/grumpy/testsuite/pkgmodel.py index f7e1564..a1162bf 100644 --- a/grumpy/testsuite/pkgmodel.py +++ b/grumpy/testsuite/pkgmodel.py @@ -11,7 +11,7 @@ from . import GrumpyTestCase from pkgcore.ebuild.repo_objs import Maintainer -from grumpy.models import Category, Ebuild, Herd, Package +from grumpy.models import Category, Developer, Ebuild, Herd, Package import copy, time, unittest @@ -19,7 +19,6 @@ class PkgModelTestCase(GrumpyTestCase): def test_portage_data_model(self): ## Create portage data - # TODO: metadata.xml contents # app-misc/testpkg C1 = 'app-misc' data = {'EAPI': '0', 'SLOT': '1.1', \ @@ -67,7 +66,7 @@ class PkgModelTestCase(GrumpyTestCase): assert p.category.name == C1 assert len(p.category.packages) == 1 assert len(p.herds) == 3 - # TODO: maintainers + assert len(p.devs) == 2 p = Package.query.filter_by(key='%s/testpkg' % C2).first() assert p.pkg == 'testpkg' @@ -77,6 +76,7 @@ class PkgModelTestCase(GrumpyTestCase): assert p.category.name == C2 assert len(p.category.packages) == 1 assert len(p.herds) == 3 + assert len(p.devs) == 2 # Test changes in herds sdata['herds'] = () @@ -134,6 +134,8 @@ class PkgModelTestCase(GrumpyTestCase): assert Ebuild.query.count() == 3 assert Package.query.count() == 2 assert Category.query.count() == 2 + assert Herd.query.count() == 3 + assert Developer.query.count() == 2 # Delete second category c = Category.query.filter_by(name=p3.category).first() @@ -150,8 +152,9 @@ class PkgModelTestCase(GrumpyTestCase): assert Package.query.count() == 0 assert Ebuild.query.count() == 0 - # Herds should be still in db + # Herds and maintainers should be still in db assert Herd.query.count() == 3 + assert Developer.query.count() == 2 def suite(): suite = unittest.TestSuite() -- cgit v1.2.3-65-gdbad