source: mauRepo/HPFos/trunk/src/HPFos/HPFos/osImpl/hpfos_conf.py @ 8346

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/HPFos/trunk/src/HPFos/HPFos/osImpl/hpfos_conf.py@8346
Revision 8346, 1.1 KB checked in by mnagni, 7 years ago (diff)

Share project "HPFos" into " http://proj.badc.rl.ac.uk/svn/ndg/mauRepo"

  • Property svn:mime-type set to text/plain
Line 
1'''
2Created on 4 May 2012
3
4@author: kusanagi
5'''
6from markup.opensearch.os_request import OpenSearchRequest
7from markup.opensearch.os_engine import OSEngine
8from myimpl import MyOSQuery, MyOSAtomResponse
9
10def 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
36if __name__ == "__main__":
37    #import sys;sys.argv = ['', 'Test.testName']
38    unittest.main()
39'''   
Note: See TracBrowser for help on using the repository browser.