From: Torsten Werner Date: Thu, 20 Jan 2011 21:58:08 +0000 (+0100) Subject: Refactor PackageTestCase.test_sources(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d3791dfe0910312c0e192f1cd81c2f55690b8f6;p=dak Refactor PackageTestCase.test_sources(). Signed-off-by: Torsten Werner --- diff --git a/tests/dbtest_packages.py b/tests/dbtest_packages.py index e9725321..8764bc78 100755 --- a/tests/dbtest_packages.py +++ b/tests/dbtest_packages.py @@ -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__':