From 8f5b351afe5245dea8180bd89f5b64774ec6c898 Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Fri, 19 Aug 2011 12:13:38 +0300 Subject: [PATCH] ppf: Use *_row methods in unit tests. --- ppf/db/tests/test_access_sqlite.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/ppf/db/tests/test_access_sqlite.py b/ppf/db/tests/test_access_sqlite.py index 4913477..721bddf 100644 --- a/ppf/db/tests/test_access_sqlite.py +++ b/ppf/db/tests/test_access_sqlite.py @@ -297,9 +297,9 @@ class AccessTest(unittest.TestCase): self.insert_test_client_sessions() # Both entries are part of client session 3. - self.dba.insert_vebose_messages_row(['3', '2455128.121295811', '0', + self.dba.insert_verbose_messages_row(['3', '2455128.121295811', '0', '127.0.0.1', '1345', '0', '3', '4', '13', '777']); - self.dba.insert_vebose_messages_row(['3', '2455129.125292872', '0', + self.dba.insert_verbose_messages_row(['3', '2455129.125292872', '0', '127.0.1.1', '1345', '0', '3', '4', '13', '778']); # Increment number of entries in verbose_messsages table. @@ -348,7 +348,7 @@ class AccessTest(unittest.TestCase): Use insert_test_swarms to add new entries in swarms table. Test number of rows selected against expected_swarms_count. """ - self.insert_test_swarms() + self.insert_test_swarms_row() self.dba.select_swarms(False) num_rows = self.get_cursor_num_rows() @@ -417,7 +417,7 @@ class AccessTest(unittest.TestCase): Use insert_test_btclients to add new entries in btclients table. Test number of rows selected against expected_btclients_count. """ - self.insert_test_btclients() + self.insert_test_btclients_row() self.dba.select_btclients(False) num_rows = self.get_cursor_num_rows() @@ -457,6 +457,18 @@ class AccessTest(unittest.TestCase): self.assertEqual(num_rows, self.expected_sessions_count) def test_insert_client_sessions_row(self): + """ + Use insert_test_client_sessions_row to add new entries. + Test number of rows selected against expected_sessions_count. + """ + self.insert_test_client_sessions_row() + + self.dba.select_client_sessions_by_id(False) + num_rows = self.get_cursor_num_rows() + + self.assertEqual(num_rows, self.expected_sessions_count) + + def test_insert_client_sessions(self): """ Use insert_test_client_sessions to add new entries. Test number of rows selected against expected_sessions_count. @@ -513,7 +525,7 @@ class AccessTest(unittest.TestCase): Use insert_test_status_messages to add new entries. Test number of rows selected against expected_statmsg_count. """ - self.insert_test_status_messages() + self.insert_test_status_messages_row() self.dba.select_status_messages(False) num_rows = self.get_cursor_num_rows() @@ -565,7 +577,7 @@ class AccessTest(unittest.TestCase): Use insert_test_verbose_messages to add new entries. Test number of rows selected against expected_verbmsg_count. """ - self.insert_test_verbose_messages() + self.insert_test_verbose_messages_row() self.dba.select_verbose_messages(False) num_rows = self.get_cursor_num_rows() -- 2.20.1