backport stable

authorSylvain Thénault <sylvain.thenault@logilab.fr>
changeset2b46b2376eb2
branchdefault
phasepublic
hiddenno
parent revision#2b49a49b23e2 use logging and not print statements (closes #64792), #0f6250ab6ab2 fix base TestCase class to enable using assertListEqual in tests
child revision#0d3439a238b1 added sql_restart_sequence to dbhelper classes (closes #65317)
files modified by this revision
test/unittest_fti.py
# HG changeset patch
# User Sylvain Thénault <sylvain.thenault@logilab.fr>
# Date 1303814460 -7200
# Tue Apr 26 12:41:00 2011 +0200
# Node ID 2b46b2376eb236beb99c7eb8434e4a29e3b174fb
# Parent 2b49a49b23e2ac5a68ac817c5d1d865f72594afb
# Parent 0f6250ab6ab27a9c59975ae9c17fd41159212ad2
backport stable

diff --git a/test/unittest_fti.py b/test/unittest_fti.py
@@ -16,11 +16,11 @@
1  #
2  # You should have received a copy of the GNU Lesser General Public License along
3  # with logilab-database. If not, see <http://www.gnu.org/licenses/>.
4  import unittest
5 
6 -from logilab.common.testlib import MockConnection
7 +from logilab.common.testlib import MockConnection, TestCase
8 
9  from logilab.database.fti import FTIndexerMixIn, tokenize, normalize
10 
11  def _tokenize(string):
12      words = []
@@ -43,11 +43,11 @@
13      def get_words(self):
14          return {'A': tokenize(u'g�nco-jpl bl� bl�p bl�p bl�p'),
15                  'B': tokenize(u'cubic')}
16 
17 
18 -class IndexerTC(unittest.TestCase):
19 +class IndexerTC(TestCase):
20 
21      def setUp(self):
22          self.cnx = MockConnection( ([1, 2],) )
23          self.indexer = FTIndexerMixIn()
24          self.indexer._cnx = self.cnx
@@ -84,11 +84,11 @@
25                            [('SELECT count(*) as rating, appears0.uid FROM appears as appears0, word as word0, appears as appears1, word as word1 WHERE word0.word = %(word0)s  AND word0.word_id = appears0.word_id  AND word1.word = %(word1)s  AND word1.word_id = appears1.word_id  AND appears0.uid = appears1.uid  GROUP BY appears0.uid ;',
26                              {'word1': 'jpl', 'word0': 'ginco'})
27                             ])
28 
29 
30 -class GetSchemaTC(unittest.TestCase):
31 +class GetSchemaTC(TestCase):
32 
33      def test(self):
34          indexer = FTIndexerMixIn()
35          indexer.sql_create_sequence = lambda x: 'CREATE SEQUENCE %s;' % x
36          self.assertEqual(indexer.sql_init_fti(),