diff options
Diffstat (limited to 'grumpy/testsuite/pkgmodel.py')
-rw-r--r-- | grumpy/testsuite/pkgmodel.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/grumpy/testsuite/pkgmodel.py b/grumpy/testsuite/pkgmodel.py index fc6a8d8..44f9dbe 100644 --- a/grumpy/testsuite/pkgmodel.py +++ b/grumpy/testsuite/pkgmodel.py @@ -12,7 +12,7 @@ from . import GrumpyTestCase from grumpy.models import Category, Ebuild, Package -import time, unittest +import copy, time, unittest class PkgModelTestCase(GrumpyTestCase): @@ -22,15 +22,15 @@ class PkgModelTestCase(GrumpyTestCase): # app-misc/testpkg C1 = 'app-misc' data = {'EAPI': '0', 'SLOT': '1.1', \ - 'DESCRIPTION': 'This is a simple description', \ - 'LONGDESCRIPTION': 'This is long description from metadata.xml', \ + 'DESCRIPTION': u'this is description', \ 'HOMEPAGE': 'http://example.org/testpkg-app-misc', \ 'KEYWORDS':'x86 amd64', \ 'IUSE':'test +positive flags -negative split-flag'} - sdata = {'longdescription': 'foo!'} - p1 = self.get_pkg('%s/testpkg-1.0-r3' % C1, sdata, data) + sdata = {'longdescription': 'this is longdescription'} + p1 = self.get_pkg('%s/testpkg-1.0-r3' % C1, sdata, copy.copy(data)) data['KEYWORDS'] = 'x86 ~amd64' - p2 = self.get_pkg('%s/testpkg-1.0-r4' % C1, sdata, data) + p2 = self.get_pkg('%s/testpkg-1.0-r4' % C1, sdata, copy.copy(data)) + # app-test/testpkg C2 = 'app-test' data = {'EAPI': '0', 'SLOT': '1.0', \ @@ -56,6 +56,14 @@ class PkgModelTestCase(GrumpyTestCase): self.db.session.commit() assert Package.query.count() == 2 + # Query info + p = Package.query.filter_by(pkg_cat='testpkg/%s' % C1).first() + assert p.pkg == 'testpkg' + assert p.desc == 'this is description' + assert p.ldesc == 'this is longdescription' + assert p.homepage == 'http://example.org/testpkg-app-misc' + assert p.category.name == C1 + def make_packages_and_ebuild(self, categories): # Create package... p = Package(categories[0], 'testpkg', 'Test Package', \ |