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/utilities/configuration.py

    r29227 r29235  
    1919
    2020    def __repr__(self):
     21        """
     22        >>> print Configuration()
     23        Tests Configuration Values:
     24          File extension: [.tar.gz]
     25          Batch manifest name: [BatchManifest.xml]
     26          XSD file: [data/xsd/BatchManifest.xsd]
     27          XML validation tool: [/usr/bin/xmllint]
     28          Limit for test failure in a single test item: [15]
     29          Tolerance for floating-point comparison: [1e-05]
     30          Different types comparison [never] fails
     31        >>> Configuration.BE_TYPE_TOLERANT = False
     32        >>> print Configuration()
     33        Tests Configuration Values:
     34          File extension: [.tar.gz]
     35          Batch manifest name: [BatchManifest.xml]
     36          XSD file: [data/xsd/BatchManifest.xsd]
     37          XML validation tool: [/usr/bin/xmllint]
     38          Limit for test failure in a single test item: [15]
     39          Tolerance for floating-point comparison: [1e-05]
     40          Different types comparison [always] fails
     41        """
    2142        from StringIO import StringIO
    2243        representation = StringIO()
     
    4162                             % tolerant)
    4263        return representation.getvalue()
     64
     65################################################################
     66#
     67# __main__
     68#
     69################################################################
     70if __name__ == '__main__':
     71    import logging
     72    import sys
     73    # Logging
     74    from utilities.psps_logger import PsPsLogger
     75    PsPsLogger.setLevel(logging.DEBUG)
     76    current_argument_position = 1
     77    while current_argument_position < len(sys.argv):
     78        if sys.argv[current_argument_position] == '-debug': # pragma: no cover
     79            PsPsLogger.set_stderr()
     80            current_argument_position += 1
     81        elif sys.argv[current_argument_position] == 'test':
     82            print 'Running unittest for Configuration class'
     83            import doctest
     84            doctest.testmod()
     85            sys.exit(0)
Note: See TracChangeset for help on using the changeset viewer.