aboutsummaryrefslogtreecommitdiff
path: root/grumpy
diff options
context:
space:
mode:
authorPriit Laes <plaes@plaes.org>2010-08-03 22:45:52 +0300
committerPriit Laes <plaes@plaes.org>2010-08-03 22:45:52 +0300
commitd7a6836d7a97b456ec4a29f4ee20b98256c65dd7 (patch)
tree39841137510a59f0fcc396738bc46ef6e4fe43b7 /grumpy
parentAdded report (diff)
downloadgsoc2010-grumpy-d7a6836d7a97b456ec4a29f4ee20b98256c65dd7.tar.gz
gsoc2010-grumpy-d7a6836d7a97b456ec4a29f4ee20b98256c65dd7.tar.bz2
gsoc2010-grumpy-d7a6836d7a97b456ec4a29f4ee20b98256c65dd7.zip
Added tests for pkg devs
Diffstat (limited to 'grumpy')
-rw-r--r--grumpy/testsuite/pkgmodel.py11
1 files 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()