From 1d3791dfe0910312c0e192f1cd81c2f55690b8f6 Mon Sep 17 00:00:00 2001 From: Torsten Werner Date: Thu, 20 Jan 2011 22:58:08 +0100 Subject: [PATCH] Refactor PackageTestCase.test_sources(). Signed-off-by: Torsten Werner --- tests/dbtest_packages.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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__': -- 2.39.5