From: Torsten Werner Date: Thu, 13 Jan 2011 21:56:08 +0000 (+0000) Subject: Improve debversion test. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=35d077b255152cadca13de999048a044207a30d6;p=dak.git Improve debversion test. Signed-off-by: Torsten Werner --- diff --git a/tests/dbtest_debversion.py b/tests/dbtest_debversion.py index 3d10b92b..548a2e8e 100755 --- a/tests/dbtest_debversion.py +++ b/tests/dbtest_debversion.py @@ -26,18 +26,22 @@ class DebVersionTestCase(DBDakTestCase): mapper(Version, self.version_table) def test_debversion(self): - v1 = Version('0.5') - self.session.add(v1) - v2 = Version('1.0') - self.session.add(v2) + v = Version('0.5~') + self.session.add(v) + v = Version('0.5') + self.session.add(v) + v = Version('1.0') + self.session.add(v) #self.session.commit() q = self.session.query(Version) - self.assertEqual(2, q.count()) + self.assertEqual(3, q.count()) self.assertEqual(2, q.filter(Version.version > '0.5~').count()) self.assertEqual(1, q.filter(Version.version > '0.5').count()) self.assertEqual(0, q.filter(Version.version > '1.0').count()) - for v in self.session.query(Version.version): - print v + q = self.session.query(func.min(Version.version)) + self.assertEqual('0.5~', q.one()[0]) + q = self.session.query(func.max(Version.version)) + self.assertEqual('1.0', q.one()[0]) def tearDown(self): self.session.close()