Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/HPFos/trunk/src/HPFos/HPFos/osImpl/hpfos_conf.py@8346
Line | |
---|
1 | ''' |
---|
2 | Created on 4 May 2012 |
---|
3 | |
---|
4 | @author: kusanagi |
---|
5 | ''' |
---|
6 | from markup.opensearch.os_request import OpenSearchRequest |
---|
7 | from markup.opensearch.os_engine import OSEngine |
---|
8 | from myimpl import MyOSQuery, MyOSAtomResponse |
---|
9 | |
---|
10 | def setUp(): |
---|
11 | query = MyOSQuery() |
---|
12 | #htmlResponse = MyOSHTMLResponse() |
---|
13 | atomResponse = MyOSAtomResponse() |
---|
14 | os_short_name = "Web Search" |
---|
15 | os_description = "A default description" |
---|
16 | os = OpenSearchRequest(query, [atomResponse], os_short_name, \ |
---|
17 | os_description) |
---|
18 | #return OSEngine(os, 'http://eo-virtual-archive4.esa.int') |
---|
19 | return OSEngine(os, 'http://localhost:8000') |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | ''' |
---|
24 | def testGetDescription(self): |
---|
25 | print self.osEngine.getDescription() |
---|
26 | |
---|
27 | def testDoQuery(self): |
---|
28 | params = {'q': ['ice', 'snow']} |
---|
29 | #mimetype = "text/html" |
---|
30 | #print self.os.doSearch(mimetype, params) |
---|
31 | format = "atom" |
---|
32 | response = self.osEngine.doSearch(format, params) |
---|
33 | print response |
---|
34 | |
---|
35 | |
---|
36 | if __name__ == "__main__": |
---|
37 | #import sys;sys.argv = ['', 'Test.testName'] |
---|
38 | unittest.main() |
---|
39 | ''' |
---|
Note: See
TracBrowser
for help on using the repository browser.