NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 369

Show
Ignore:
Timestamp:
09/03/10 13:49:36
Author:
cbc
Message:

Doctests for classes in parse module.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spongenet/trunk/spongenet/parse.py

    r368 r369  
    189189    """ 
    190190    A data point for a sponge sensor sample." 
     191 
     192    Instantiate a valid Point object. 
     193 
     194    >>> xmldoc_glob = os.path.join( 
     195    ...                   os.path.dirname( 
     196    ...                       os.path.abspath(__file__)), 
     197    ...                   TEST_PATH, "xml","*","*.xml") 
     198    >>> _xmldoc_path = glob.glob(xmldoc_glob)[0] 
     199    >>> _xmldoc = xmldoc(_xmldoc_path) 
     200    >>> _data = Data(_xmldoc) 
     201    >>> point = _data.devices[0].sensors[0].points[0] 
     202    >>> point.id != None 
     203    True 
     204    >>> point.descr != None 
     205    True 
     206    >>> point.type != None 
     207    True 
     208    >>> point.format != None 
     209    True 
     210    >>> point.unit != None 
     211    True 
     212    >>> point.rangemin != None 
     213    True 
     214    >>> point.rangemax != None 
     215    True 
     216    >>> point.value != None 
     217    True 
    191218    """ 
    192219 
     
    203230    """ 
    204231    A collection of data points for a sponge sensor sample. 
     232 
     233    Instantiate a valid Sensor object. 
     234 
     235    >>> xmldoc_glob = os.path.join( 
     236    ...                   os.path.dirname( 
     237    ...                       os.path.abspath(__file__)), 
     238    ...                   TEST_PATH, "xml","*","*.xml") 
     239    >>> _xmldoc_path = glob.glob(xmldoc_glob)[0] 
     240    >>> _xmldoc = xmldoc(_xmldoc_path) 
     241    >>> _data = Data(_xmldoc) 
     242    >>> sensor = _data.devices[0].sensors[0] 
     243    >>> len(sensor.points) 
     244    3 
     245    >>> sensor.id != None 
     246    True 
     247    >>> sensor.serialno != None 
     248    True 
     249    >>> sensor.prodno != None 
     250    True 
     251    >>> sensor.prodname != None 
     252    True 
     253    >>> sensor.descr != None 
     254    True 
     255    >>> sensor.adr != None 
     256    True 
     257    >>> sensor.protocolver != None 
     258    True 
     259    >>> sensor.verticalposition != None 
     260    True 
     261    >>> sensor.status != None 
     262    True 
    205263    """ 
    206264 
     
    221279    """ 
    222280    Data from a collection of sponge sensors for a single time sample. 
     281 
     282    Instantiate a valid Device object. 
     283 
     284    >>> xmldoc_glob = os.path.join( 
     285    ...                   os.path.dirname( 
     286    ...                       os.path.abspath(__file__)), 
     287    ...                   TEST_PATH, "xml","*","*.xml") 
     288    >>> _xmldoc_path = glob.glob(xmldoc_glob)[0] 
     289    >>> _xmldoc = xmldoc(_xmldoc_path) 
     290    >>> _data = Data(_xmldoc) 
     291    >>> device = _data.devices[0] 
     292    >>> len(device.sensors) 
     293    15 
     294    >>> device.id != None 
     295    True 
     296    >>> device.sessionid != None 
     297    True 
     298    >>> device.descr != None 
     299    True 
     300    >>> device.serialno != None 
     301    True 
     302    >>> device.prodno != None 
     303    True 
     304    >>> device.prodname != None 
     305    True 
     306    >>> device.devicetype != None 
     307    True 
     308    >>> device.protocolver != None 
     309    True 
     310    >>> device.time != None 
     311    True 
     312    >>> device.status != None 
     313    True 
     314    >>> device.location != None 
     315    True 
     316    >>> device.verticalposition != None 
     317    True 
     318    >>> device.owner != None 
     319    True 
     320    >>> device.recordnumber != None 
     321    True 
     322    >>> device.data_time != None 
     323    True 
     324    >>> device.data_sessionid != None 
     325    True 
    223326    """ 
    224327 
     
    250353    """ 
    251354    A collection of sponge data samples from a collection of sensors. 
     355 
     356    Instantiate a valid Data object. 
     357 
     358    >>> xmldoc_glob = os.path.join( 
     359    ...                   os.path.dirname( 
     360    ...                       os.path.abspath(__file__)), 
     361    ...                   TEST_PATH, "xml","*","*.xml") 
     362    >>> _xmldoc_path = glob.glob(xmldoc_glob)[0] 
     363    >>> _xmldoc = xmldoc(_xmldoc_path) 
     364    >>> _data = Data(_xmldoc) 
     365    >>> _data.xmlns 
     366    '{http://www.aadi.no/RTOutSchema}' 
     367    >>> len(_data.devices) 
     368    50 
    252369    """ 
    253370