From 45b7a3adc3a8e3669d15598d67f99513856fbab0 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Sat, 3 Jul 2010 00:53:04 +0300 Subject: [PATCH] Document FTP: improve the tests Now, a non-existing path will return 550, an exception. bzr revid: p_christ@hol.gr-20100702215304-7l2pit3ceih3wvo9 --- addons/document_ftp/test/document_ftp_test2.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/addons/document_ftp/test/document_ftp_test2.yml b/addons/document_ftp/test/document_ftp_test2.yml index e0b3b72b320..a5eaa13521f 100644 --- a/addons/document_ftp/test/document_ftp_test2.yml +++ b/addons/document_ftp/test/document_ftp_test2.yml @@ -145,8 +145,13 @@ - !python {model: ir.attachment}: | from document_ftp import test_easyftp as te + from ftplib import error_perm ftp = te.get_ftp_folder(cr, uid, self, 'Documents') - assert ftp.nlst("test-name.txt") == [] + try: + res = ftp.nlst("test-name.txt") + assert res == [] + except error_perm, e: + pass assert ftp.nlst("test-renamed.txt") == ['test-renamed.txt'] - I create a new folder 'Test-Folder2' through FTP @@ -203,7 +208,7 @@ 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() > 1000) + assert len(ftp.nlst()) > 1000 - I read the 1000 files, check speed # TODO