source: exist/trunk/python/ndgutilstests/testconstants.py @ 4663

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/trunk/python/ndgutilstests/testconstants.py@4663
Revision 4663, 8.2 KB checked in by cbyrom, 11 years ago (diff)

Re-organise contents of ndgUtils to make more logical and refactor references.

Line 
1"""
2Constants to use in the various test cases
3
4NERC Data Grid Project
5"""
6__author__ = "C Byrom - Tessella"
7__date__ = "03/09/08"
8__copyright__ = "(C) 2008 STFC & NERC"
9__license__ = \
10"""This software may be distributed under the terms of the Q Public
11License, version 1.0 or later."""
12__contact__ = "b.n.lawrence@rl.ac.uk"
13__revision__ = '$Id: $'
14
15from ndgUtils.models.vocabtermdata import VocabTermData as VTD
16import os
17
18BASE_DIR = 'ndgutilstests'
19
20curDir = os.getcwd()
21prefix = ''
22if not curDir.endswith(BASE_DIR):
23    prefix = '..' + os.sep
24   
25TEST_DATA_DIR = prefix + 'testdata' + os.sep
26DBCONFIG_FILE = TEST_DATA_DIR + 'exist.config'
27TEST_GRANULITE = TEST_DATA_DIR + 'example.granulite'
28
29NDG_CONFIG_FILE = TEST_DATA_DIR + 'ndgDiscovery.config'
30DIF_FILE = TEST_DATA_DIR + 'dataent_NDSC_DIF.xml'
31
32GRANULITE_TITLE = 'this is a new test granulite'
33GRANULITE_TIME_AXIS = 'time0'
34GRANULITE_CDML_DATASETID = 'test_hadgem1_dataset'
35GRANULITE_PROVIDER_ID = 'badc.nerc.ac.uk'
36GRANULITE_DATASETID = 'calum_data_set'
37GRANULITE_LOGO = 'http:/blah/blah/a_logo_icon.png'
38GRANULITE_AUTHOR_NAME = 'calum byrom'
39GRANULITE_AUTHOR_URI = 'www.cb.org'
40GRANULITE_AUTHOR_ROLE = 'Data migrator'
41GRANULITE_T1 = '1996-4-19'
42GRANULITE_T2 = '1998-9-22'
43
44VALID_REPOSITORY = "chinook.badc.rl.ac.uk"
45VALID_PROVIDER_ID = 'badc.nerc.ac.uk'
46VALID_MOLES_DOC_ID = 'dataent_hadisst'
47VALID_NDGA_DOC_ID = 'COAPEC_500YrRun_wholerun_annual_atmos'
48VALID_NUMSIM_DOC_ID = 'HadGEM1_CodeBase'
49VALID_ATOM_DOC_ID = 'dataent_11679938403412067'
50
51VALID_DISCOVERY_PROVIDER_ID = "csl.gov.uk"
52VALID_DISCOVERY_DOC_ID = "csl.gov.uk__1"       
53
54validParams = ['OZONE MIXING RATIO (PPB ) | http://vocab.ndg.nerc.ac.uk/blah | OZONE', \
55               'ERROR FLAG (OZONE MIXING RATIO ) | http://vocab.ndg.nerc.ac.uk/blah | ERROR', \
56               'HYDROGEN PEROXIDE PPBV | http://vocab.ndg.nerc.ac.uk/blah | HYDROGEN',
57               'CADMIUM >1.21 M DIAMETER (PMOL M-3) INSTRUMENTAL DETECTION LIMIT 0.132 NM']
58
59messyParams = ['OZONE MIXING RATIO &  (PPB     ) | http://vocab.ndg.nerc.ac.uk/blah | ozone', \
60               'ERROR FLAG (OZONE MIXING > RATIO  ) | http://vocab.ndg.nerc.ac.uk/blah | error', \
61               'Hydrogen Peroxide < ppbv | http://vocab.ndg.nerc.ac.uk/blah | hydrogen &']
62
63summaryText = 'this is a summary of the granulite'
64
65csmlFile = '/db/moles_support/csml/csml_famous_control_month.xml'
66
67logo = '/blah/blah/a_logo_icon.png'
68
69title = 'this is a test granulite'
70
71datasetID = 'famous_control_month_test_file'
72
73id = 'tag:localhost:5000,2008-09-17:/view/badc.nerc.ac.uk__ATOM__' + datasetID
74
75atomName = 'http://localhost:5000/view/badc.nerc.ac.uk__ATOM__' + datasetID
76
77name = datasetID + '.atom'
78
79VTD = VTD()
80T1 = '2792-12-16'
81T2 = '2992-11-16'
82minX = '-90.0'
83minY = '-90.0'
84maxX = '360.0'
85maxY = '5505.29980469'
86
87xmlString = '<entry xmlns:georss="http://www.georss.org/georss/10" xmlns:gml="http://www.opengis.net/gml" ' + \
88    'xmlns:moles="http://ndg.nerc.ac.uk/schema/moles2beta">' + \
89    '<id>' + id + '</id>' + \
90    '<title>' + title + '</title>' + \
91        '<link href="' + atomName + '" rel="self"/>' + \
92        '<link href="http://badc.nerc.ac.uk/a-real-wms-endpoint" rel="http://vocab.ndg.nerc.ac.uk/term/P201/1/GCMDU026" title="WMS"/>' + \
93        '<link href="http://badc.nerc.ac.uk/alternate" rel="http://vocab.ndg.nerc.ac.uk/term/C110/6/GD" title="alternate page"/>' + \
94        '<link href="' + logo + '" title="' + VTD.TERM_DATA[VTD.LOGO_TERM].title + '" rel="http://vocab.ndg.nerc.ac.uk/term/C110/6/GD/Logo"/>' + \
95        '<author><name>Tiddeman, David</name><uri>www.cb.org</uri></author>' + \
96        '<contributor><name>Brian Bandy</name><uri>www.cb.org</uri></contributor>' + \
97        '<moles:entity type="granule"><moles:molesISO><moles:responsibleParties>' + \
98            '<moles:responsibleParty><name>calum byrom</name><uri>www.cb.org</uri><role>Metadata maintainer</role></moles:responsibleParty>' + \
99            '<moles:responsibleParty><name>dom lowe</name><uri>www.badc.rl.ac.uk</uri><role>Metadata maintainer</role></moles:responsibleParty>' + \
100            '</moles:responsibleParties><moles:datasetLanguage>English</moles:datasetLanguage>' + \
101            '<moles:providerID>badc.nerc.ac.uk</moles:providerID>' + \
102            '<moles:metadataLanguage>English</moles:metadataLanguage>' + \
103            '</moles:molesISO>' + \
104        '</moles:entity>' + \
105        '<category term="OZONE" scheme="http://vocab.ndg.nerc.ac.uk/term/C110/6/GD" label="OZONE MIXING RATIO (PPB )"/>' + \
106        '<category term="ERROR" scheme="http://vocab.ndg.nerc.ac.uk/term/C110/6/GD" label="ERROR FLAG (OZONE MIXING RATIO )"/>' + \
107        '<category term="HYDROGEN" scheme="http://vocab.ndg.nerc.ac.uk/term/C110/6/GD" label="HYDROGEN PEROXIDE PPBV"/>' + \
108        '<category term="ATOM_TYPE" scheme="GRAN - NOT YET SET UP/None/GRANULE" label="GRANULE"></category>' + \
109        '<summary>' + summaryText + '</summary>' + \
110        '<content src="' + csmlFile + '" type="application/xml"/>' + \
111        '<published>2008-06-17T10:15:19</published>' + \
112        '<moles:temporalRange>' + T1 + '/' + T2 + '</moles:temporalRange>' + \
113        '<georss:where><gml:Envelope><gml:lowerCorner>' + minX + ' ' + minY + '</gml:lowerCorner><gml:upperCorner>' + maxX + ' ' + maxY + '</gml:upperCorner></gml:Envelope></georss:where>' + \
114    '</entry>'
115
116INVALID_TITLE = '\xa2'
117invalidXmlString = '<entry xmlns:georss="http://www.georss.org/georss/10" xmlns:gml="http://www.opengis.net/gml" ' + \
118    'xmlns:moles="http://ndg.nerc.ac.uk/schema/moles2beta">' + \
119    '<id>' + id + '</id>' + \
120        '<link href="' + atomName + '" rel="self"/>' + \
121        '<link href="http://badc.nerc.ac.uk/a-real-wms-endpoint" rel="http://vocab.ndg.nerc.ac.uk/term/P201/1/GCMDU026" title="WMS"/>' + \
122        '<link href="http://badc.nerc.ac.uk/alternate" rel="alternate" title="alternate page"/>' + \
123        '<link href="' + logo + '" title="' + VTD.TERM_DATA[VTD.LOGO_TERM].title + '" rel="' + VTD.LOGO_TERM + '"/>' + \
124        '<contributor><name>Brian Bandy</name><uri>www.cb.org</uri></contributor>' + \
125        '<moles:entity type="granule"><moles:molesISO><moles:responsibleParties>' + \
126            '<moles:responsibleParty><name>calum byrom</name><uri>www.cb.org</uri><role>Metadata maintainer</role></moles:responsibleParty>' + \
127            '<moles:responsibleParty><name>dom lowe</name><uri>www.badc.rl.ac.uk</uri><role>Metadata maintainer</role></moles:responsibleParty>' + \
128            '</moles:responsibleParties><moles:datasetLanguage>English</moles:datasetLanguage>' + \
129            '<moles:providerID>badc.nerc.ac.uk</moles:providerID>' + \
130            '<moles:metadataLanguage>English</moles:metadataLanguage>' + \
131            '</moles:molesISO>' + \
132        '</moles:entity>' + \
133        '<category term="OZONE" scheme="http://vocab.ndg.nerc.ac.uk/blah" label="OZONE MIXING RATIO (PPB )"/>' + \
134        '<category term="ERROR" scheme="http://vocab.ndg.nerc.ac.uk/blah" label="ERROR FLAG (OZONE MIXING RATIO )"/>' + \
135        '<category term="HYDROGEN" scheme="http://vocab.ndg.nerc.ac.uk/blah" label="HYDROGEN PEROXIDE PPBV"/>' + \
136        '<category term="ATOM_TYPE" scheme="GRAN - NOT YET SET UP/None/GRANULE" label="GRANULE"></category>' + \
137        '<summary>' + summaryText + '</summary>' + \
138        '<content src="' + csmlFile + '" type="application/xml"/>' + \
139        '<published>2008-06-17T10:15:19</published>' + \
140        '<moles:temporalRange>' + T1 + '/' + T2 + '</moles:temporalRange>' + \
141        '<georss:where><gml:Envelope><gml:lowerCorner>' + minX + ' ' + maxX + '</gml:lowerCorner><gml:upperCorner>' + minY + ' ' + maxY + '</gml:upperCorner></gml:Envelope></georss:where>' + \
142    '</entry>'
143
144   
145validAuthor = 'Tiddeman, David'
146validAuthors = [validAuthor + ' | www.cb.org', \
147                    'Brian Bandy | www.cb.org']
148   
149validGranuleAuthors = ['calum byrom | www.cb.org | Metadata maintainer', \
150                    'dom lowe | www.badc.rl.ac.uk | Metadata maintainer']
151
152validLinks = ['http://badc.nerc.ac.uk/a-real-wms-endpoint | WMS | http://vocab.ndg.nerc.ac.uk/term/P201/1/GCMDU026',\
153              'http://badc.nerc.ac.uk/alternate | alternate page | alternate',
154              '/blah/blah/a_logo_icon.png | logo | LOGO - NOT YET SET UP',
155              '/db/moles_support/granuleAtom/famous_control_month_granule.moles']
156
Note: See TracBrowser for help on using the repository browser.