93 lines
3.4 KiB
YAML
93 lines
3.4 KiB
YAML
-
|
|
In order to check international character functionality
|
|
-
|
|
!python {model: ir.attachment}: |
|
|
from document_ftp import test_easyftp as te
|
|
ftp = te.get_plain_ftp(timeout=1.0)
|
|
-
|
|
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
|
|
-
|
|
!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 'ÄïêéìÞ.txt' 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 'Üëëïò'
|
|
-
|
|
!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)
|
|
|
|
-
|
|
I delete the testing folders
|
|
-
|
|
!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.rmd('Äïêéìáóôéêüò ÖÜêåëëïò/Üëëïò')
|
|
ftp.rmd('Äïêéìáóôéêüò ÖÜêåëëïò')
|