Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
    def test_getAllMsgs_err(self):

        dbUtil.getAllMsgs(self.conn, 'not_exist_table')
Ejemplo n.º 5
0
    def test_getAllMsgs_not_exist_msg(self):

        expected = ()
        actual = dbUtil.getAllMsgs(self.conn, 'test_table')

        eq_(actual, expected)