source: orange/Orange/testing/regression/tests_20/modules_server_files2.py @ 9952:986e9cd806f4

Revision 9952:986e9cd806f4, 803 bytes checked in by Miha Stajdohar <miha.stajdohar@…>, 2 years ago (diff)

Tests moved and renamed from orange 20.

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.