Document FTP: tests for utf8 chars in document names.

bzr revid: p_christ@hol.gr-20100708225202-wbgmrf141j5g1501
This commit is contained in:
P. Christeas 2010-07-09 01:52:02 +03:00
parent 7dd8a1a885
commit 819eed88a2
1 changed files with 57 additions and 4 deletions

View File

@ -2,24 +2,77 @@
In order to check international character functionality
-
I create in the server a folder called 'Äïêéìáóôéêüò ÖÜêåëëïò'
-
!record {model: document.directory, id: dir_itests }:
name: 'Äïêéìáóôéêüò ÖÜêåëëïò'
parent_id: document.dir_root
-
And then I create another folder, under it, through FTP
-
!python {model: ir.attachment}: |
cr.commit()
from document_ftp import test_easyftp as te
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò')
ftp.mkd("ÖÜêåëëïò áðü êÜôù")
-
I check that this folder exists at the server
-
!assert {model: document.directory, id: , search: "[('name','=','ÖÜêåëëïò áðü êÜôù')]" }:
- parent_id != False
-
I login with FTP and check that 'Äïêéìáóôéêüò ÖÜêåëëïò' is there
-
!python {model: ir.attachment}: |
from document_ftp import test_easyftp as te
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
-
I create a file named 'ÄïêéìÞ' into that folder
-
I cerate another folder called 'äïê. directory 2' in there
!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/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
fdata = StringIO('êåßìåíï ìå utf-8')
ftp.storbinary('STOR ÄïêéìÞ.txt', fdata)
-
I remove the 'äïê. directory 2'
I remove the 'ÄïêéìÞ.txt' file
-
I remove the 'ÄïêéìÞ' file
!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/Äïêéìáóôéêüò ÖÜêåëëïò/ÖÜêåëëïò áðü êÜôù')
ftp.delete('ÄïêéìÞ.txt')
-
I rename 'Äïêéìáóôéêüò ÖÜêåëëïò' into 'Üëëïò'
I rename 'ÖÜêåëëïò áðü êÜôù' into 'Üëëïò'
-
!python {model: ir.attachment}: |
from document_ftp import test_easyftp as te
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Äïêéìáóôéêüò ÖÜêåëëïò')
ftp.rename("ÖÜêåëëïò áðü êÜôù", "Üëëïò")
-
I place a file 'file Ö3' in 'Üëëïò'
-
!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/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
fdata = StringIO('êé Üëëï êåßìåíï')
ftp.storbinary('STOR file Ö3.txt', fdata)
-
I rename the file into file+range(1..200) (large filename)
-
!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/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
vuvuzela = 'b'+''.join('z' * 200)+'!'
ftp.rename("file Ö3.txt", vuvuzela)
-
I delete the file with the large name
-
!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/Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
vuvuzela = 'b'+''.join('z' * 200)+'!'
ftp.delete(vuvuzela)