source: orange/orange/doc/modules/server_files2.py @ 5894:2dd205051aea

Revision 5894:2dd205051aea, 803 bytes checked in by blaz <blaz.zupan@…>, 5 years ago (diff)

a regression test script for orngServerFiles, initial commit

Line 
1import orngServerFiles
2reload(orngServerFiles)
3
4domain = "demo"
5# remove the domain from the local repository
6if domain in orngServerFiles.listdomains():
7    orngServerFiles.remove_domain(domain, force=True)
8
9# download all the files for this domain from the server
10server = orngServerFiles.ServerFiles()
11for filename in server.listfiles(domain):
12    orngServerFiles.download(domain, filename, verbose=False)
13
14# make sure that both file lists are the same
15files_on_server = server.listfiles(domain)
16print "Domain: %s" % domain
17intersection = set(files_on_server).intersection(set(orngServerFiles.listfiles(domain)))
18if len(intersection) == len(files_on_server):
19    print "Same number of files on server and local repository."
20else:
21    print "Directories on server and local repository are different." 
Note: See TracBrowser for help on using the repository browser.