source: MILK/trunk/milk_server/milk_server/tests/lib/testutilities.py @ 4472

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/tests/lib/testutilities.py@4472
Revision 4472, 1.1 KB checked in by cbyrom, 12 years ago (diff)

Strip out code not relevant to MILK - mainly WCS and WMS stuff - also including the CSML server code + trackback code
Also tidy up structure of 'public' dir - setting up new 'style' dir and
centralising icons in icons dir + remove all unused icons, javascript and stylesheets.
Also strip out testcase code and populate new test directory structure.

Line 
1import unittest
2from milk_server.lib.Utilities import *
3
4class TestCase(unittest.TestCase):
5    """ Tests as required """
6
7    # TODO: these files are not available in the codebase... fix!
8    configFile='examples/example.config'
9    difFile='examples/neodc.eg1.dif'
10   
11    def setUp(self):
12        # If pkg_resources is available assume the module is eggified and
13        # get a stream to the input data from the egg.
14        #try:
15        #    import pkg_resources
16        #    f = pkg_resources.resource_stream(__name__, self.configFile)
17        #except ImportError:
18            # Else take the input file from __file__
19            #import os
20        self.config=myConfig(self.configFile)
21        f=file(self.difFile,'r')
22        self.difxml=f.read()
23            #f=file(os.path.join(os.path.basepath(__file__), self.configFile))
24
25        #self.config=myConfig(f)
26
27    def testConfig(self):
28        print 'Discovery Icon [%s]'%self.config.get('DISCOVERY','icon')
29       
30    def testidget(self):
31        self.assertEqual(idget(self.difxml),'NOCSDAT192')
32
33
34if __name__=="__main__":
35    unittest.main()
36
37
38
Note: See TracBrowser for help on using the repository browser.