2
In order to test the document_ftp functionality
4
I open the HTTP port and perform an OPTIONS request to the server
6
!python {model: ir.attachment}: |
7
from document_webdav import test_davclient as te
11
dc.get_creds(self, cr, uid)
12
dc.gd_options(path=cr.dbname, expect={'DAV': ['1',]})
14
I will test the propnames at the document root
16
!python {model: ir.attachment}: |
17
from document_webdav import test_davclient as te
19
dc.get_creds(self, cr, uid)
20
dc.gd_propname(path=cr.dbname+'/Documents/')
22
I will test the ETags of the document root
24
!python {model: ir.attachment}: |
25
from document_webdav import test_davclient as te
27
dc.get_creds(self, cr, uid)
28
dc.gd_getetag(path=cr.dbname+'/Documents/')
31
I will now ls -l the document root.
33
!python {model: ir.attachment}: |
34
from document_webdav import test_davclient as te
36
dc.get_creds(self, cr, uid)
37
res = dc.gd_lsl(path=cr.dbname+'/Documents/')
39
print "%(type)s\t%(uid)s\t%(gid)s\t%(size)s\t%(mtime)s\t%(name)s" % lin
41
I will put a file to the server
43
!python {model: ir.attachment}: |
44
from document_webdav import test_davclient as te
47
dc.get_creds(self, cr, uid)
48
tdp = addons.get_module_resource('document_webdav', 'test_davclient.py')
49
res = dc.gd_put(path=cr.dbname+'/Documents/test_davclient.py', srcpath=tdp)
51
I will try to get the file from the root
53
!python {model: ir.attachment}: |
54
from document_webdav import test_davclient as te
57
dc.get_creds(self, cr, uid)
58
tdp = addons.get_module_resource('document_webdav', 'test_davclient.py')
59
res = dc.gd_get(path=cr.dbname+'/Documents/test_davclient.py', crange=(4,508), compare=tdp)