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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/MolesManager/trunk/src/libs/migration/tests/loadresource.py@8475
Revision 8409, 1.5 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 7 Mar 2012
3
4@author: mnagni
5'''
6from unittest import TestCase
7from libs.commons_db import DbManager
8from libs.migration.MigrationEPB import MigrationEPB
9from libs.migration.processor.loadResources import LoadResources
10from libs.migration.db.classes import DataEntityMigration
11from libs.migration.processor.commons import calculateHash
12from libs.migration.tests.testconfig import MIGRATION_DB_CONNECTION,\
13    MIGRATION_DB_SCRIPT
14
15class LoadResourceTest(TestCase):
16    '''
17    classdocs
18    '''
19
20    def setUp(self):
21        migrationDB = DbManager(MIGRATION_DB_CONNECTION, MIGRATION_DB_SCRIPT)
22        #MigrationEPB.overrrideDBManager(migrationDB)     
23
24    def testLoadResource(self):
25        lr = LoadResources()
26        migrationClass = DataEntityMigration
27        doc_id = 123
28        docHash = calculateHash('123_docHash')
29        docCreation = '2009-12-10T03:16:25Z'
30        lr.createMigrationDoc(migrationClass, doc_id, '123_docName', '123_ddocOwner', '123_docStatus', docHash, docCreation)
31        self.assertTrue(lr.updateMigrationDoc(migrationClass, doc_id, docHash, docCreation))
32        self.assertTrue(lr.updateMigrationDoc(migrationClass, doc_id, calculateHash('321_docHash'), docCreation))
33        self.assertTrue(lr.updateMigrationDoc(migrationClass, doc_id, calculateHash('321_docHash'), '2012-12-10T03:16:25Z'))
34               
35        self.assertFalse(lr.updateMigrationDoc(migrationClass, 321, docHash, docCreation))
36       
37       
38       
39       
Note: See TracBrowser for help on using the repository browser.