def test_insert_message(self): expected = ([1], ['test_message']) dbUtil.insert_message(self.conn, 'test_table', 'test_message') actual = dbUtil.getAllMsgs(self.conn, 'test_table') eq_(actual, expected)
def test_getAllMsgs(self): expected = ([1], ['test_message']) dbUtil.insert_message(self.conn, 'test_table', 'test_message') (no_list, msg_list) = dbUtil.getAllMsgs(self.conn, 'test_table') actual = (no_list, msg_list) eq_(actual, expected)
def test_insert_message_rollback02(self): expected = () dbUtil.insert_message(self.conn, 'test_table', 'test_message') dbUtil.insert_message(self.conn, 'not_exist_table', 'rollback_message') self.conn.rollback() actual = dbUtil.getAllMsgs(self.conn, 'test_table') eq_(actual, expected)
def test_getAllMsgs_err(self): dbUtil.getAllMsgs(self.conn, 'not_exist_table')
def test_getAllMsgs_not_exist_msg(self): expected = () actual = dbUtil.getAllMsgs(self.conn, 'test_table') eq_(actual, expected)