[test] replace assertTrue(a == b) with assertEqual(a, b)

authorJulien Cristau <julien.cristau@logilab.fr>
changesetc401854d203b
branchdefault
phasepublic
hiddenno
parent revision#62386f95f6a5 [graph] More explicit error message if dot is not found (closes #253516)
child revision#ee0548a2abbe [compat] Remove callable (related to #264017)
files modified by this revision
test/unittest_table.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1410181578 -7200
# Mon Sep 08 15:06:18 2014 +0200
# Node ID c401854d203b30433b701008d97b13a3395de60d
# Parent 62386f95f6a55fc60d27cafd483867d4592959e2
[test] replace assertTrue(a == b) with assertEqual(a, b)

diff --git a/test/unittest_table.py b/test/unittest_table.py
@@ -62,18 +62,18 @@
1          self.assertEqual(tab, [[1], [2]])
2          self.assertEqual(tab[:, 0], [1, 2])
3 
4      def test_indexation(self):
5          """we should be able to use [] to access rows"""
6 -        self.assertTrue(self.table[0] == self.table.data[0])
7 -        self.assertTrue(self.table[1] == self.table.data[1])
8 +        self.assertEqual(self.table[0], self.table.data[0])
9 +        self.assertEqual(self.table[1], self.table.data[1])
10 
11      def test_iterable(self):
12          """test iter(table)"""
13          it = iter(self.table)
14 -        self.assertTrue(next(it) == self.table.data[0])
15 -        self.assertTrue(next(it) == self.table.data[1])
16 +        self.assertEqual(next(it), self.table.data[0])
17 +        self.assertEqual(next(it), self.table.data[1])
18 
19      def test_get_rows(self):
20          """tests Table.get_rows()"""
21          self.assertEqual(self.table, [[0, 0], [0, 0], [0, 0]])
22          self.assertEqual(self.table[:], [[0, 0], [0, 0], [0, 0]])
@@ -305,21 +305,21 @@
23          """
24          self.table.set_row(0, [10, 20, 0])
25          self.stylesheet.add_rowavg_rule((0, 2), 0, 0, 1)
26          self.table.apply_stylesheet(self.stylesheet)
27          val = self.table[0, 2]
28 -        self.assertTrue(int(val) == 15)
29 +        self.assertEqual(int(val), 15)
30 
31 
32      def test_rowsum_rule(self):
33          """Tests that add_rowsum_rule works as expected
34          """
35          self.table.set_row(0, [10, 20, 0])
36          self.stylesheet.add_rowsum_rule((0, 2), 0, 0, 1)
37          self.table.apply_stylesheet(self.stylesheet)
38          val = self.table[0, 2]
39 -        self.assertTrue(val == 30)
40 +        self.assertEqual(val, 30)
41 
42 
43      def test_colavg_rule(self):
44          """Tests that add_colavg_rule works as expected
45          """
@@ -327,11 +327,11 @@
46          self.table.append_row([12, 8, 3], 'row2')
47          self.table.create_row('row3')
48          self.stylesheet.add_colavg_rule((2, 0), 0, 0, 1)
49          self.table.apply_stylesheet(self.stylesheet)
50          val = self.table[2, 0]
51 -        self.assertTrue(int(val) == 11)
52 +        self.assertEqual(int(val), 11)
53 
54 
55      def test_colsum_rule(self):
56          """Tests that add_colsum_rule works as expected
57          """
@@ -339,11 +339,11 @@
58          self.table.append_row([12, 8, 3], 'row2')
59          self.table.create_row('row3')
60          self.stylesheet.add_colsum_rule((2, 0), 0, 0, 1)
61          self.table.apply_stylesheet(self.stylesheet)
62          val = self.table[2, 0]
63 -        self.assertTrue(val == 22)
64 +        self.assertEqual(val, 22)
65 
66 
67 
68  class TableStyleTC(TestCase):
69      """Test suite for TableSuite"""