Revision: 750
Author: keith.dart
Date: Fri Apr 25 21:25:57 2014 UTC
Log: Change constant names to reflect usage better. Add new dependency.
http://code.google.com/p/pycopia/source/detail?r=750
Modified:
/trunk/QA/pycopia/QA/constants.py
/trunk/QA/pycopia/QA/testrunner.py
/trunk/QA/pycopia/reports/database.py
/trunk/QA/setup.py
=======================================
--- /trunk/QA/pycopia/QA/constants.py Tue Oct 27 03:23:42 2009 UTC
+++ /trunk/QA/pycopia/QA/constants.py Fri Apr 25 21:25:57 2014 UTC
@@ -21,7 +21,7 @@
- NA: A result that is not applicable (e.g. it is a holder of tests).
- EXPECTED_FAIL: Means the test is failing due to a bug, and is already
- known to fail.
+ known to fail.
"""
@@ -41,6 +41,6 @@
# Type of objects the TestRunner can run, and reports can be generated
# from.
-OBJECTTYPES =
aid.Enums("module", "TestSuite", "Test", "TestRunner", "unknown")
-[MODULE, SUITE, TEST, RUNNER, UNKNOWN] = OBJECTTYPES
+OBJECTTYPES =
aid.Enums("UseCase", "TestSuite", "Test", "TestRunner", "unknown")
+[USECASE, SUITE, TEST, RUNNER, UNKNOWN] = OBJECTTYPES
=======================================
--- /trunk/QA/pycopia/QA/testrunner.py Fri Aug 2 07:49:54 2013 UTC
+++ /trunk/QA/pycopia/QA/testrunner.py Fri Apr 25 21:25:57 2014 UTC
@@ -176,7 +176,7 @@
cls.test_name = ".".join([cls.__module__, cls.__name__])
ID = get_module_version(sys.modules[cls.__module__])
rpt.add_message("MODULEVERSION", ID)
- rpt.add_message("MODULESTARTTIME", timelib.now())
+ rpt.add_message("USECASESTARTTIME", timelib.now())
try:
rv = self.run_object(cls)
except KeyboardInterrupt:
@@ -215,7 +215,7 @@
mod.test_name = mod.__name__
ID = get_module_version(mod)
cf.report.add_message("MODULEVERSION", ID)
- cf.report.add_message("MODULESTARTTIME", timelib.now())
+ cf.report.add_message("USECASESTARTTIME", timelib.now())
try:
rv = self.run_object(mod)
except KeyboardInterrupt:
=======================================
--- /trunk/QA/pycopia/reports/database.py Sun Sep 23 04:54:22 2012 UTC
+++ /trunk/QA/pycopia/reports/database.py Fri Apr 25 21:25:57 2014 UTC
@@ -1,5 +1,5 @@
#!/usr/bin/python2.7
-# -*- coding: us-ascii -*-
+# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
@@ -30,6 +30,10 @@
from pycopia.db import types
+[USECASE, SUITE, TEST, RUNNER, UNKNOWN] = types.OBJECTTYPES
+[EXPECTED_FAIL, NA, ABORT, INCOMPLETE, FAILED, PASSED] = types.TESTRESULTS
+
+
PROJECT_RE = re.compile(r"(\w+)[ \-.:](\d+)\.(\d+)\.(\d+)[\.\-](\d+)")
_COLUMNS = {
@@ -43,7 +47,7 @@
"starttime": None, # STARTTIME (Test, Suite), RUNNERSTART
(module)
"endtime": None, # ENDTIME (Test, Suite), RUNNEREND (module)
"arguments": None, # TESTARGUMENTS (Test), RUNNERARGUMENTS
(module)
- "result": None, # PASSED, FAILED, EXPECTED_FAIL,
INCOMPLETE, ABORT
+ "result": NA, # PASSED, FAILED, EXPECTED_FAIL,
INCOMPLETE, ABORT
"diagnostic": None, # The diagnostic message before failure.
"resultslocation": None, # url
"testimplementation": None, # implementation
@@ -53,9 +57,6 @@
"testsuite": None, # an associated suite
}
-[MODULE, SUITE, TEST, RUNNER, UNKNOWN] = types.OBJECTTYPES
-[EXPECTED_FAIL, NA, ABORT, INCOMPLETE, FAILED, PASSED] = types.TESTRESULTS
-
class ResultHolder(object):
def __init__(self):
@@ -205,11 +206,11 @@
# When constructing a report from report messages:
# transition table:
-#from: to: RUNNER MODULE SUITE TEST
-# RUNNER NA push push push
-# MODULE pop add push push
-# SUITE pop pop add push
-# TEST pop pop pop add
+# from: to: RUNNER USECASE SUITE TEST
+# RUNNER NA push push push
+# USECASE pop add push push
+# SUITE pop pop add push
+# TEST pop pop pop add
class DatabaseReport(reports.NullReport):
@@ -285,8 +286,8 @@
currenttype = self._currentresult.get("objecttype")
if currenttype == RUNNER:
self.push_result(level) # runner -> (suite | test)
- elif currenttype == MODULE:
- self.push_result(level) # module -> (suite | test)
+ elif currenttype == USECASE:
+ self.push_result(level) # module/usecase -> (suite | test)
elif currenttype == SUITE:
if level == 1: # suite -> suite
self.add_result(level)
@@ -320,18 +321,18 @@
self._currentresult.set("endtime", datetime.fromtimestamp(msg))
elif msgtype == "MODULEVERSION":
self._testid = msg
- elif msgtype == "MODULESTARTTIME":
+ elif msgtype == "USECASESTARTTIME":
currenttype = self._currentresult.get("objecttype")
if currenttype == RUNNER:
self.push_result(0) # runner -> module
self._currentresult.set("starttime",
datetime.fromtimestamp(msg))
- elif currenttype == MODULE:
- self.add_result(0) # module -> module
+ elif currenttype == USECASE:
+ self.add_result(0) # module/usecase ->
module/usecase
self._currentresult.set("starttime",
datetime.fromtimestamp(msg))
elif currenttype == SUITE:
- self.pop_result() # suite -> module
+ self.pop_result() # suite -> module/usecase
elif currenttype == TEST:
- self.pop_result() # test -> module
+ self.pop_result() # test -> module/usecase
elif msgtype == "MODULEENDTIME":
currenttype = self._currentresult.get("objecttype")
if currenttype == SUITE:
=======================================
--- /trunk/QA/setup.py Thu Apr 11 19:03:13 2013 UTC
+++ /trunk/QA/setup.py Fri Apr 25 21:25:57 2014 UTC
@@ -76,6 +76,7 @@
# 'pycopia-storage>=1.0.dev-r138,<=dev',
# 'pycopia-WWW>=1.0.dev-r279,<=dev',
# 'Pyro4>=4.13',
+# 'chardet>=2.2',
# ],
dependency_links = [
"
http://www.pycopia.net/download/"