From 45ce2234577fc5df16c25ebe45a9e4f5597f3213 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 17 Dec 2012 02:56:51 +0100 Subject: [PATCH] cleanup tests bzr revid: al@openerp.com-20121217015651-qdw4iugzh9ghwv19 --- addons/document/document.py | 2 -- addons/document/test/document_test2.yml | 1 - .../document_ftp/test/document_ftp_test2.yml | 26 +++++++------------ 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 2ae5d55b7ad..6c75b60fcfe 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -2055,10 +2055,8 @@ class nodefd_db(StringIO, node_descriptor): if mode in ('r', 'r+'): data = ira_browse.datas - print "READ64",data if data: data = data.decode('base64') - print "READ",data self._size = len(data) StringIO.__init__(self, data) elif mode in ('w', 'w+'): diff --git a/addons/document/test/document_test2.yml b/addons/document/test/document_test2.yml index 2ee3cda76a0..beff61d4d0f 100644 --- a/addons/document/test/document_test2.yml +++ b/addons/document/test/document_test2.yml @@ -32,7 +32,6 @@ !assert {model: ir.attachment, id: file_test2 }: - datas == "YWJjZA==\n" - file_size == 4 - - file_type == 'text/plain' - I rename the attachment. - diff --git a/addons/document_ftp/test/document_ftp_test2.yml b/addons/document_ftp/test/document_ftp_test2.yml index eb86a99407d..ce8e25906d2 100644 --- a/addons/document_ftp/test/document_ftp_test2.yml +++ b/addons/document_ftp/test/document_ftp_test2.yml @@ -235,43 +235,37 @@ - I check that test3.txt is removed. - - I create 200 files through FTP + I create 5 files through FTP - !python {model: ir.attachment}: | from document_ftp import test_easyftp as te from cStringIO import StringIO ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') fdata = StringIO('abcd') - # TODO speed - for i in range(0, 200): + for i in range(0, 5): fdata.seek(0) ftp.storbinary('STOR test-name%s.txt' %i, fdata) ftp.close() - - I list the 200 files, check speed + I list the 5 files, check speed - !python {model: ir.attachment}: | from document_ftp import test_easyftp as te ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') - # TODO speed - assert len(ftp.nlst()) >= 200, "We haven't managed to store 200 files!" + assert len(ftp.nlst()) >= 5, "We haven't managed to store 5 files!" - - I read the 200 files, check speed - # TODO + I read the 5 files, check speed - - I move the 200 files to 'Test-Folder2' - # TODO - + I move the 5 files to 'Test-Folder2' - - I delete the 200 files + I delete the 5 files - !python {model: ir.attachment}: | from document_ftp import test_easyftp as te from cStringIO import StringIO ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Test-Folder2') - # TODO speed ftp.delete('test3.txt') - for i in range(0, 200): + for i in range(0, 5): ftp.delete('test-name%s.txt' %i) ftp.close() @@ -282,11 +276,9 @@ from document_ftp import test_easyftp as te from cStringIO import StringIO ftp = te.get_ftp_folder(cr, uid, self, 'Documents') - # TODO speed ftp.delete('test.txt') ftp.delete('test-renamed.txt') - ftp.close() - + ftp.close() - I remove the 'Test-Folder2' -