Files
odoo_source/addons/document_ftp/test/document_ftp_test3.yml
T

93 lines
4.2 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 a folder called '������������ ��������' in the server.
-
!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('Äïêéìáóôéêüò ÖÜêåëëïò')