doc ftp: yaml tests for files/folders in wrong dirs.
bzr revid: p_christ@hol.gr-20101027102323-jtiwjjr52lht0dvr
This commit is contained in:
@@ -113,6 +113,35 @@
|
||||
- parent_id.name == 'Documents'
|
||||
- res_model == 'res.partner'
|
||||
- res_id != False
|
||||
-
|
||||
I try to create a file directly under the Partners Testing folder
|
||||
-
|
||||
!python {model: ir.attachment}: |
|
||||
from document_ftp import test_easyftp as te
|
||||
import ftplib
|
||||
from cStringIO import StringIO
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing')
|
||||
fdata = StringIO('abcd')
|
||||
try:
|
||||
ftp.storbinary('STOR stray.txt', fdata)
|
||||
assert False, "We should't be able to create files here"
|
||||
except ftplib.error_perm:
|
||||
# That's what should happen
|
||||
pass
|
||||
-
|
||||
I try to create a folder directly under the Partners Testing folder
|
||||
-
|
||||
!python {model: ir.attachment}: |
|
||||
from document_ftp import test_easyftp as te
|
||||
import ftplib
|
||||
from cStringIO import StringIO
|
||||
ftp = te.get_ftp_folder(cr, uid, self, 'Documents/Partners Testing')
|
||||
try:
|
||||
ftp.mkd('Weird folder')
|
||||
assert False, "We should't be able to create folders here"
|
||||
except ftplib.error_perm:
|
||||
# That's what should happen
|
||||
pass
|
||||
-
|
||||
I check that all/Partner1 also has the file
|
||||
- |
|
||||
|
||||
Reference in New Issue
Block a user