- Timestamp:
- Sep 24, 2010, 3:50:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sc_branches/psps_testing/utilities/test_product.py
r29227 r29235 7 7 enriched with anything useful for following tests. 8 8 """ 9 def __init__(self ):9 def __init__(self, success = False): 10 10 """ 11 11 Creates a test product and set the success status to False. … … 13 13 >>> print TestProduct().success 14 14 False 15 >>> print TestProduct(True).success 16 True 15 17 """ 16 self.success = False18 self.success = success 17 19 18 20 if __name__ == '__main__': 21 import logging 19 22 import sys 20 if len(sys.argv) == 2 and sys.argv[1]=='test': 21 print 'Running TestProduct unit tests' 22 import doctest 23 doctest.testmod() 24 sys.exit(0) 23 current_argument_position = 1 24 while current_argument_position < len(sys.argv): 25 if sys.argv[current_argument_position] == '-debug': # pragma: no cover 26 PsPsLogger.setLevel(logging.DEBUG) 27 PsPsLogger.set_stderr() 28 current_argument_position += 1 29 elif sys.argv[current_argument_position] == 'test': 30 print 'Running unittest for TestProduct class' 31 import doctest 32 doctest.testmod() 33 sys.exit(0) 25 34
Note:
See TracChangeset
for help on using the changeset viewer.
