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/test_report.py

    r29227 r29235  
    3232        """
    3333        Creates singleton instance.
     34
     35        >>> tr1 = TestReportClass()
     36        >>> tr2 = TestReportClass()
     37        >>> tr1.id() == tr2.id()
     38        True
    3439        """
    3540        # Check whether we already have an instance
     
    7176
    7277if __name__ == '__main__':
    73     if len(sys.argv)<2:
    74         import doctest
    75         doctest.testmod()
    76         sys.exit(0)
    77     TestReport.ok('Req1')
    78     TestReport.ko('Req2', 'A good reason for failure')
     78    import logging
     79    import sys
     80    current_argument_position = 1
     81    while current_argument_position < len(sys.argv):
     82        if sys.argv[current_argument_position] == '-debug': # pragma: no cover
     83            PsPsLogger.setLevel(logging.DEBUG)
     84            PsPsLogger.set_stderr()
     85            current_argument_position += 1
     86        elif sys.argv[current_argument_position] == 'test':
     87            print 'Running unittest for TestReport class'
     88            import doctest
     89            doctest.testmod()
     90            sys.exit(0)
Note: See TracChangeset for help on using the changeset viewer.