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

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

Incomplete - # 22490: CEDA Observation Collection - Description
 http://team.ceda.ac.uk/trac/ceda/ticket/22490

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 createCI_Citation,\
8    createMD_Identifier
9from ea_model.ceda_metadatamodel.ceda_observation.ceda_observation import CEDA_Observation
10from ea_model.ceda_metadatamodel.ceda_project.ceda_project import CEDA_Project
11
12def createObservationCollection():
13    '''
14        Creates a CEDA_ObservationCollection with the following data:
15        oc.identifier[0].code = 'test_code'
16        oc.identifier[0].authority.title = 'test_title'
17    '''
18    observationCollection = CEDA_ObservationCollection()
19    auth = createCI_Citation('test_title')
20    i_identifier = createMD_Identifier(code = 'test_code', authority=auth)
21    observationCollection.identifier.append(i_identifier)     
22    return observationCollection
23
24def createObservation():
25    '''
26        Creates a CEDA_Observation with the following data:
27        oc.identifier[0].code = 'test_code'       
28        oc.identifier[0].authority.title = 'test_title'
29        oc.identifier[1].code = 'mau_code'       
30        oc.identifier[1].authority.title = 'mau_title'       
31    '''
32    observation = CEDA_Observation()
33    i_identifier = createMD_Identifier(code = 'test_code', authority=createCI_Citation('test_title'))
34    observation.identifier.append(i_identifier)     
35    i_identifier = createMD_Identifier(code = 'mau_code', authority=createCI_Citation('mau_title'))
36    observation.identifier.append(i_identifier) 
37    observation.dataLineage = "test_dataLineage"       
38    return observation
39
40'''
41def createCI_Responsibility():
42
43        Creates a CI_Responsibility with the following data:
44        ci_responsibilty.role = 'ci_rolecode.CI_RoleCode.cl_author
45        ci_responsibilty.party[0]
46            CI_Individual.name = 'individual_1'
47        ci_responsibilty.party[1]
48            CI_Organization.name = 'organization_1'
49       
50    ci_responsibilty = CI_Responsibility()
51    ci_responsibilty.role = ci_rolecode.CI_RoleCode.cl_author
52    ci_individual_1 = createCI_Individual('individual_1')
53    ci_responsibilty.party.append(ci_individual_1)
54    ci_organization_1 = createCI_Organization('organization_1')
55    ci_responsibilty.party.append(ci_organization_1)   
56    return ci_responsibilty
57'''
58
59def createProject():
60    '''
61        Creates a CEDA_Project with the following data:
62        project.abstract = 'test_abstract'               
63    '''   
64    ceda_project = CEDA_Project()
65    ceda_project.abstract = 'test_abstract' 
66    return ceda_project
Note: See TracBrowser for help on using the repository browser.