Changeset 8546 for mauRepo


Ignore:
Timestamp:
30/08/12 10:10:17 (7 years ago)
Author:
mnagni
Message:

Complete - # 22528: Migration of FAtCat Open Search link for HPFeld
 http://team.ceda.ac.uk/trac/ceda/ticket/22528
Corrected some unittests

Location:
mauRepo/MolesManager/trunk/cedaMoles
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • mauRepo/MolesManager/trunk/cedaMoles/libs/migration/processor/commons.py

    r8545 r8546  
    969969    return ceda_project 
    970970 
    971 def from_date_string_to_pt(start, end): 
    972     """ 
    973         Transforms a date string like '2002-07-22' (startDate) in a TM_Instant instance or    
    974         '2002-07-22/2011-08-06' (start/endDate) in a TM_Period instance 
    975         @param doc_phenomenon_time: a date string in the expected format 
    976     """ 
     971def from_date_string_to_pt(start = None, end = None): 
     972    """ 
     973    Transforms a date string like '2002-07-22' (start) in a TM_Instant instance or    
     974        pair '2002-07-22', '2011-08-06' (start, end) in a TM_Period instance 
     975    **Parameters** 
     976        * start:String - the start date with format YYYY-MM-DD 
     977        * end:String - the end date with format YYYY-MM-DD 
     978         
     979    **Returns** 
     980        A TM_Instant if only `start` has a value not None 
     981        A TM_Period if both `start` and `end` have values not None 
     982    """     
    977983    pt = None 
    978984    if end is not None and start is not None: 
  • mauRepo/MolesManager/trunk/cedaMoles/tests/moles2gui/creationFactory.py

    r8517 r8546  
    102102    return identifier 
    103103 
    104 def assembleObservation(phenomenonTime = '2002-07-22/2011-08-06'): 
     104def assembleObservation(start = '2002-07-22', end ='2011-08-06'): 
    105105    ceda_observation = CEDA_Observation() 
    106106    ceda_observation.relatedParty = assembleMO_ResponsiblePartyInfo() 
    107107    ceda_observation.resultTime = assembleTM_Instant() 
    108     ceda_observation.phenomenonTime = from_date_string_to_pt(phenomenonTime) 
     108    ceda_observation.phenomenonTime = from_date_string_to_pt(start, end) 
    109109    bb = create_ex_geographic_boundingbox(180, 90, -180, -90) 
    110110    bb.id = 12     
  • mauRepo/MolesManager/trunk/cedaMoles/tests/moles2gui/om/period.py

    r8537 r8546  
    5151        Validates a simple encode/decode 
    5252        """ 
    53         period = from_date_string_to_pt('2002-07-22/2011-08-06')  
     53        period = from_date_string_to_pt('2002-07-22', '2011-08-06')  
    5454        json = encodeCedaMoles2Json(period) 
    5555        #----------------------- test ------------------------ 
     
    6969        Decodes an updated json object 
    7070        """ 
    71         period = from_date_string_to_pt('2002-07-22/2011-08-06')  
     71        period = from_date_string_to_pt('2002-07-22', '2011-08-06')  
    7272        json = encodeCedaMoles2Json(period) 
    7373        dec_json = loads(json) 
Note: See TracChangeset for help on using the changeset viewer.