IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 24, 2010, 3:50:36 PM (16 years ago)
Author:
Serge CHASTEL
Message:

Improved unit tests/code coverage. Some refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/sc_branches/psps_testing/psi/psi_inquisitor.py

    r29227 r29235  
    135135                # position...
    136136                values = line.split(',')
    137                 if len(values) != len(contents['fields']):
    138                     # I wonder if this test is relevant.
    139                     # We should trust the server response at least
    140                     # at the protocol level...
     137                if len(values) != len(contents['fields']): # pragma: no cover
     138                    # I wonder if this test is relevant.  We should
     139                    # trust the server response at least at the
     140                    # protocol level...
    141141                    raise Exception("Different array length? %d vs %d"
    142142                                    % (len(values), len(contents['fields'])))
     
    154154if __name__ == '__main__':
    155155    import logging
    156     PsPsLogger.set_stderr()
    157     PsPsLogger.setLevel(logging.DEBUG)
    158     import doctest
    159     doctest.testmod()
     156    import sys
     157    PsPsLogger.setLevel(logging.INFO)
     158    PsPsLogger.set_stdout()
     159    current_argument_position = 1
     160    while current_argument_position < len(sys.argv):
     161        if sys.argv[current_argument_position] == '-debug': # pragma: no cover
     162            PsPsLogger.set_stderr()
     163            current_argument_position += 1
     164        elif sys.argv[current_argument_position] == 'test':
     165            print 'Running unittest for PsiInquisitor class'
     166            import doctest
     167            doctest.testmod(exclude_empty = True)
     168            sys.exit(0)
Note: See TracChangeset for help on using the changeset viewer.