doc webdav: support for GET and PUT at yaml tests
[odoo/odoo.git] / addons / document_webdav / test / webdav_test1.yml
1 -
2     In order to test the document_ftp functionality
3 -
4     I open the HTTP port and perform an OPTIONS request to the server
5 -
6     !python {model: ir.attachment}: |
7         from document_webdav import test_davclient as te
8         reload(te) # reload..
9         dc = te.DAVClient()
10         dc.gd_options()
11         dc.get_creds(self, cr, uid)
12         dc.gd_options(path=cr.dbname, expect={'DAV': ['1',]})
13 -
14     I will test the propnames at the document root
15 -
16     !python {model: ir.attachment}: |
17         from document_webdav import test_davclient as te
18         dc = te.DAVClient()
19         dc.get_creds(self, cr, uid)
20         dc.gd_propname(path=cr.dbname+'/Documents/')
21 -
22     I will test the ETags of the document root
23 -
24     !python {model: ir.attachment}: |
25         from document_webdav import test_davclient as te
26         dc = te.DAVClient()
27         dc.get_creds(self, cr, uid)
28         dc.gd_getetag(path=cr.dbname+'/Documents/')
29
30 -
31     I will now ls -l the document root.
32 -
33     !python {model: ir.attachment}: |
34         from document_webdav import test_davclient as te
35         dc = te.DAVClient()
36         dc.get_creds(self, cr, uid)
37         res = dc.gd_lsl(path=cr.dbname+'/Documents/')
38         for lin in res:
39             print "%(type)s\t%(uid)s\t%(gid)s\t%(size)s\t%(mtime)s\t%(name)s" % lin
40 -
41     I will put a file to the server
42 -
43     !python {model: ir.attachment}: |
44         from document_webdav import test_davclient as te
45         import addons
46         dc = te.DAVClient()
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)
50 -
51     I will try to get the file from the root
52 -
53     !python {model: ir.attachment}: |
54         from document_webdav import test_davclient as te
55         import addons
56         dc = te.DAVClient()
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', compare=tdp)