Menu

#312 [Python] Enum type can not be insert to cubrid using python driver

open
nobody
None
5
2012-10-11
2012-10-11
Jira Trac
No

Test verion:
{noformat}
Cubrid: CUBRID 9.0 (9.0.0.0455)
PHP Driver:
{noformat}
Python Driver:
http://svn.cubrid.org/cubridapis/python/branches/RB-9.0.0/ Revision: 852
{noformat}

Codes
{noformat}

def test_insert(self):
print enum type insert!
nsql3=insert into enum01 values(1,1,1),(2,'Tuesday','No'), (3, 'Wednesday','Cancel')
c3=self.cursor.execute(nsql3)
self.assertEquals(c3,3)
#self.conn.commit()

def test_select(self):
print normal select !
nsql4 = select count(*) from enum01
self.cursor.execute(nsql4)
self.row_sl=self.cursor.fetchone ()
c_sl=self.row_sl[0]
self.assertEqual(c_sl,3)
{noformat}

Result:
{noformat}
test_select (__main__.Enum01Test) ... normal select !
FAIL

======================================================================
FAIL: test_select (__main__.Enum01Test)
----------------------------------------------------------------------
Traceback (most recent call last):
File enum_01.py, line 53, in test_select
self.assertEqual(c_sl,3)
AssertionError: 0 != 3

{noformat}

The select result show that the data is not inserted successfully.
When I use csql execute these sql statments, data is inserted successfully

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.