Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/standard/
Date: Tue, 02 Aug 2011 18:53:36
Message-Id: 3d662ee7757f26772bf0a343e56a77398893da06.mgorny@gentoo
1 commit: 3d662ee7757f26772bf0a343e56a77398893da06
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 18:13:00 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 18:13:00 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=3d662ee7
7
8 Fix AA test, use .assert*Equal() in KV/AA tests.
9
10 ---
11 pmstestsuite/library/standard/deprecated_vars.py | 17 +++++++++++------
12 1 files changed, 11 insertions(+), 6 deletions(-)
13
14 diff --git a/pmstestsuite/library/standard/deprecated_vars.py b/pmstestsuite/library/standard/deprecated_vars.py
15 index fce66f9..4b8b672 100644
16 --- a/pmstestsuite/library/standard/deprecated_vars.py
17 +++ b/pmstestsuite/library/standard/deprecated_vars.py
18 @@ -2,6 +2,8 @@
19 # (c) 2011 Michał Górny <mgorny@g.o>
20 # Released under the terms of the 2-clause BSD license.
21
22 +import os.path
23 +
24 from pmstestsuite.library.standard.dbus_case import DBusEbuildTestCase
25 from pmstestsuite.library.standard.ext_cases import DBusFetchingEbuildTestCase
26
27 @@ -20,18 +22,19 @@ class AATest(DBusFetchingEbuildTestCase):
28
29 def __init__(self, *args, **kwargs):
30 DBusFetchingEbuildTestCase.__init__(self, *args, **kwargs)
31 + self._expect_fn = os.path.split(self.ebuild_vars['SRC_URI'])[1]
32 self.ebuild_vars['SRC_URI'] = 'pms_tests_magical_hidden_use? ( %s )' \
33 % self.ebuild_vars['SRC_URI']
34
35 def check_dbus_result(self, output, pm):
36 if self.eapi < 4:
37 - expect = 'pms-test-suite-dummy.html'
38 + expect = self._expect_fn
39 else:
40 expect = ''
41
42 - return output == expect \
43 - and DBusEbuildTestCase.check_dbus_result(self, output, pm)
44 -
45 + DBusEbuildTestCase.check_dbus_result(self, output, pm)
46 + self.assertEqual(output, expect, '${AA}')
47 +
48 class KVTest(DBusEbuildTestCase):
49 """ Test whether KV is declared. """
50
51 @@ -43,5 +46,7 @@ class KVTest(DBusEbuildTestCase):
52 }
53
54 def check_dbus_result(self, output, pm):
55 - return bool(output) ^ (self.eapi == 4) \
56 - and DBusEbuildTestCase.check_dbus_result(self, output, pm)
57 + DBusEbuildTestCase.check_dbus_result(self, output, pm)
58 + func = self.assertEqual if self.eapi == 4 \
59 + else self.assertNotEqual
60 + func(output, '', '${KV}')