[Greater-commits] r356 - trunk/GREAT-ER-DB/impl/postgresql/test
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jul 6 16:39:13 CEST 2011
Author: bricks
Date: 2011-07-06 16:39:13 +0200 (Wed, 06 Jul 2011)
New Revision: 356
Modified:
trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_p_bin_obj.py
Log:
Fix testcase: buffer is a python variable -> use buf
read buffer
Modified: trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_p_bin_obj.py
===================================================================
--- trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_p_bin_obj.py 2011-07-06 14:38:11 UTC (rev 355)
+++ trunk/GREAT-ER-DB/impl/postgresql/test/test_pg_p_bin_obj.py 2011-07-06 14:39:13 UTC (rev 356)
@@ -52,8 +52,8 @@
filename = os.path.abspath(os.path.join("data", "itterrivernet.dbf"))
filesize = os.stat(filename)[ST_SIZE]
f = open(filename, 'rb')
- buffer = f.read()
- bin_obj_record = DA_S_bin_obj({'bin_obj_id':0,'object_id':2,'name':filename,'user_id':'anonym','privs':6,'obj_type':'CATCHMENT','obj_sub_type':'RIVERNET','file_type':'DBF','file_obj':buffer,'file_size':filesize,'cre_date':'30-11-2003','mod_date':'29-11-2003','write':'2','remark':'remark_string here!'})
+ buf = f.read()
+ bin_obj_record = DA_S_bin_obj({'bin_obj_id':0,'object_id':2,'name':filename,'user_id':'anonym','privs':6,'obj_type':'CATCHMENT','obj_sub_type':'RIVERNET','file_type':'DBF','file_obj':buf,'file_size':filesize,'cre_date':'30-11-2003','mod_date':'29-11-2003','write':'2','remark':'remark_string here!'})
self.res = da_insert_bin_obj(bin_obj_record)
da_db_commit()
self.assertEquals(self.res,None)
@@ -62,7 +62,9 @@
filename = "itterrivernet.dbf"
filepath = os.path.abspath("data")
filesize = os.stat(os.path.join(filepath, filename))[ST_SIZE]
- bin_obj_record = DA_S_bin_obj({'bin_obj_id':0,'object_id':2,'name':filename,'user_id':'anonym','privs':6,'obj_type':'CATCHMENT','obj_sub_type':'RIVERNET','file_type':'DBF','file_obj':buffer,'file_size':filesize,'cre_date':'30-11-2003','mod_date':'29-11-2003','write':'2','remark':'remark_string here!'})
+ f = open(filename, 'rb')
+ buf = f.read()
+ bin_obj_record = DA_S_bin_obj({'bin_obj_id':0,'object_id':2,'name':filename,'user_id':'anonym','privs':6,'obj_type':'CATCHMENT','obj_sub_type':'RIVERNET','file_type':'DBF','file_obj':buf,'file_size':filesize,'cre_date':'30-11-2003','mod_date':'29-11-2003','write':'2','remark':'remark_string here!'})
self.res = da_load_bin_obj(bin_obj_record, "Y", filepath, filename)
da_db_commit()
self.assertEquals(self.res,None)
More information about the Greater-commits
mailing list