source: mauRepo/MolesManager/trunk/src/libs/migration/tests/deployment_tests.py @ 8083

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

Verified that ingests MO_RsponsiblePartyInfo
Better implementation for lists in Model2Form but has to solve the visualization problem (forms into forms?)
CEDA_Observation ingestion duplicates each time the same ingested record. To fix (tomorrow?)
Added some tests to migration
Now can the migration client ingest single data_entity

Line 
1'''
2Created on 1 Feb 2012
3
4@author: mnagni
5'''
6from  unittest import TestCase
7from libs.migration.processor.deployment import DeploymentProcessor
8from ea_model.moles3_4.utilities.mo_rolevalue import MO_RoleValue
9class DeploymentTest(TestCase):
10    '''
11    classdocs
12    '''
13
14    def setUp(self):
15        self.name = "UK Meteorological Office, Max Planck Institute for Meteorology, Laboratoire de Meteorologie Dynamique, Rutherford Appleton Laboratory,"
16
17    def test_extractAuthors(self):
18        dp = DeploymentProcessor(None, None, None)
19        authors = dp._extractAuthors(self.name)
20        self.assertTrue(len(authors) == 4)
21        return authors
22                               
23           
24    def test_newResponsiblePartyInfos(self):   
25        dp = DeploymentProcessor(None, None, None)
26        authors = self.test_extractAuthors()
27        newResponsiblePartyInfos = []
28        dp._extractResponsiblePartyInfo(authors, newResponsiblePartyInfos)             
29        self.assertTrue(len(newResponsiblePartyInfos) == 2)
30        for respParty in newResponsiblePartyInfos:
31            if respParty.role == MO_RoleValue.cl_author:
32                self.assertTrue(len(respParty.party) == 1)
33            elif respParty.role == MO_RoleValue.cl_coinvestigator:
34                self.assertTrue(len(respParty.party) == 3)
35               
36
37   
Note: See TracBrowser for help on using the repository browser.