]> err.no Git - dak/commitdiff
Refactor PackageTestCase.test_sources().
authorTorsten Werner <twerner@debian.org>
Thu, 20 Jan 2011 21:58:08 +0000 (22:58 +0100)
committerTorsten Werner <twerner@debian.org>
Thu, 20 Jan 2011 21:58:08 +0000 (22:58 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
tests/dbtest_packages.py

index e97253213c38ad8ea4366967a0f1b74329e72659..8764bc78a4139152d790baf867cf1835711f9107 100755 (executable)
@@ -209,12 +209,9 @@ class PackageTestCase(DBDakTestCase):
         'test relation between DBSource and PoolFile'
 
         self.setup_sources()
-        poolfile_hello = self.session.query(DBSource)[0].poolfile
-        self.assertEqual(self.file['hello'], poolfile_hello)
-        self.assertEqual(self.source, poolfile_hello.source)
-        poolfile_sl = self.session.query(PoolFile). \
-            filter(PoolFile.filename.like('%/sl/%'))[0]
-        self.assertEqual(None, poolfile_sl.source)
+        self.assertEqual(self.file['hello'], self.source.poolfile)
+        self.assertEqual(self.source, self.file['hello'].source)
+        self.assertEqual(None, self.file['sl'].source)
 
 
 if __name__ == '__main__':