cleanup tests

bzr revid: al@openerp.com-20121217015651-qdw4iugzh9ghwv19
This commit is contained in:
Antony Lesuisse 2012-12-17 02:56:51 +01:00
parent 92e8304acb
commit 45ce223457
3 changed files with 9 additions and 20 deletions

View File

@ -2055,10 +2055,8 @@ class nodefd_db(StringIO, node_descriptor):
if mode in ('r', 'r+'): if mode in ('r', 'r+'):
data = ira_browse.datas data = ira_browse.datas
print "READ64",data
if data: if data:
data = data.decode('base64') data = data.decode('base64')
print "READ",data
self._size = len(data) self._size = len(data)
StringIO.__init__(self, data) StringIO.__init__(self, data)
elif mode in ('w', 'w+'): elif mode in ('w', 'w+'):

View File

@ -32,7 +32,6 @@
!assert {model: ir.attachment, id: file_test2 }: !assert {model: ir.attachment, id: file_test2 }:
- datas == "YWJjZA==\n" - datas == "YWJjZA==\n"
- file_size == 4 - file_size == 4
- file_type == 'text/plain'
- -
I rename the attachment. I rename the attachment.
- -

View File

@ -235,43 +235,37 @@
- -
I check that test3.txt is removed. I check that test3.txt is removed.
- -
I create 200 files through FTP I create 5 files through FTP
- -
!python {model: ir.attachment}: | !python {model: ir.attachment}: |
from document_ftp import test_easyftp as te from document_ftp import test_easyftp as te
from cStringIO import StringIO from cStringIO import StringIO
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2')
fdata = StringIO('abcd') fdata = StringIO('abcd')
# TODO speed for i in range(0, 5):
for i in range(0, 200):
fdata.seek(0) fdata.seek(0)
ftp.storbinary('STOR test-name%s.txt' %i, fdata) ftp.storbinary('STOR test-name%s.txt' %i, fdata)
ftp.close() ftp.close()
- -
I list the 200 files, check speed I list the 5 files, check speed
- -
!python {model: ir.attachment}: | !python {model: ir.attachment}: |
from document_ftp import test_easyftp as te from document_ftp import test_easyftp as te
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2')
# TODO speed assert len(ftp.nlst()) >= 5, "We haven't managed to store 5 files!"
assert len(ftp.nlst()) >= 200, "We haven't managed to store 200 files!"
- -
I read the 200 files, check speed I read the 5 files, check speed
# TODO
- -
I move the 200 files to 'Test-Folder2' I move the 5 files to 'Test-Folder2'
# TODO
- -
I delete the 200 files I delete the 5 files
- -
!python {model: ir.attachment}: | !python {model: ir.attachment}: |
from document_ftp import test_easyftp as te from document_ftp import test_easyftp as te
from cStringIO import StringIO from cStringIO import StringIO
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2')
# TODO speed
ftp.delete('test3.txt') ftp.delete('test3.txt')
for i in range(0, 200): for i in range(0, 5):
ftp.delete('test-name%s.txt' %i) ftp.delete('test-name%s.txt' %i)
ftp.close() ftp.close()
@ -282,11 +276,9 @@
from document_ftp import test_easyftp as te from document_ftp import test_easyftp as te
from cStringIO import StringIO from cStringIO import StringIO
ftp = te.get_ftp_folder(cr, uid, self, 'Documents') ftp = te.get_ftp_folder(cr, uid, self, 'Documents')
# TODO speed
ftp.delete('test.txt') ftp.delete('test.txt')
ftp.delete('test-renamed.txt') ftp.delete('test-renamed.txt')
ftp.close() ftp.close()
- -
I remove the 'Test-Folder2' I remove the 'Test-Folder2'
- -