diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/subunit/__init__.py | 28 | ||||
-rwxr-xr-x | python/samba/subunit/run.py | 21 |
2 files changed, 30 insertions, 19 deletions
diff --git a/python/samba/subunit/__init__.py b/python/samba/subunit/__init__.py index 7b609c3ef7..f452db6dde 100644 --- a/python/samba/subunit/__init__.py +++ b/python/samba/subunit/__init__.py @@ -16,3 +16,31 @@ # """Subunit test protocol.""" + +import datetime + + +PROGRESS_SET = 0 +PROGRESS_CUR = 1 +PROGRESS_PUSH = 2 +PROGRESS_POP = 3 + + +# From http://docs.python.org/library/datetime.html +_ZERO = datetime.timedelta(0) + +# A UTC class. + +class UTC(datetime.tzinfo): + """UTC""" + + def utcoffset(self, dt): + return _ZERO + + def tzname(self, dt): + return "UTC" + + def dst(self, dt): + return _ZERO + +utc = UTC() diff --git a/python/samba/subunit/run.py b/python/samba/subunit/run.py index 33efd4f6f7..dbe6b241c8 100755 --- a/python/samba/subunit/run.py +++ b/python/samba/subunit/run.py @@ -24,6 +24,8 @@ $ python -m samba.subunit.run mylib.tests.test_suite """ +from samba.subunit import UTC + import datetime import os import sys @@ -31,25 +33,6 @@ import traceback import unittest -# From http://docs.python.org/library/datetime.html -_ZERO = datetime.timedelta(0) - -# A UTC class. - -class UTC(datetime.tzinfo): - """UTC""" - - def utcoffset(self, dt): - return _ZERO - - def tzname(self, dt): - return "UTC" - - def dst(self, dt): - return _ZERO - -utc = UTC() - # Whether or not to hide layers of the stack trace that are # unittest/testtools internal code. Defaults to True since the # system-under-test is rarely unittest or testtools. |