source: mauRepo/MolesManager/trunk/src/libs/migration/tests/test_utils.py @ 8205

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/tests/test_utils.py@8205
Revision 8205, 1.6 KB checked in by mnagni, 9 years ago (diff)

Complete - # 22416: CEDA MOLES3 - search function - by title keyword
 http://team.ceda.ac.uk/trac/ceda/ticket/22416

Line 
1'''
2Created on 31 Mar 2012
3
4@author: mnagni
5'''
6from ea_model.ceda_metadatamodel.ceda_observationcollection.ceda_observationcollection import CEDA_ObservationCollection
7from libs.migration.processor.commons import createMD_Identifier,\
8    createCI_Citation
9from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation
10
11def createObservationCollection():
12    '''
13        Creates a CEDA_ObservationCollection with the following data:
14        oc.identifier[0].code = 'test_code'
15        oc.identifier[0].authority.title = 'test_title'
16    '''
17    observationCollection = CEDA_ObservationCollection()
18    auth = createCI_Citation('test_title')
19    i_identifier = createMD_Identifier(code = 'test_code', authority=auth)
20    observationCollection.identifier.append(i_identifier)     
21    return observationCollection
22
23def createObservation():
24    '''
25        Creates a CEDA_Observation with the following data:
26        oc.identifier[0].code = 'test_code'       
27        oc.identifier[0].authority.title = 'test_title'
28        oc.identifier[1].code = 'mau_code'       
29        oc.identifier[1].authority.title = 'mau_title'       
30    '''
31    observation = CEDA_Observation()
32    i_identifier = createMD_Identifier(code = 'test_code', authority=createCI_Citation('test_title'))
33    observation.identifier.append(i_identifier)     
34    i_identifier = createMD_Identifier(code = 'mau_code', authority=createCI_Citation('mau_title'))
35    observation.identifier.append(i_identifier) 
36    observation.dataLineage = "test_dataLineage"       
37    return observation
Note: See TracBrowser for help on using the repository browser.