diff options
author | John Doe <jdoe@example.com> | 2009-06-14 14:34:11 +1000 |
---|---|---|
committer | John Doe <jdoe@example.com> | 2009-06-14 14:34:11 +1000 |
commit | b0c7c274d394ccfba2ea84fa6e9785f41f4cddd8 (patch) | |
tree | 2fa7b24b86aa2151d62400afabf908bda72cd5bc /libbe/hg.py | |
parent | a711ecf10df62e30d83c1941065404c53fecd35b (diff) | |
download | bugseverywhere-b0c7c274d394ccfba2ea84fa6e9785f41f4cddd8.tar.gz |
Make RCS testcase subclasses dynamically.
Diffstat (limited to 'libbe/hg.py')
-rw-r--r-- | libbe/hg.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libbe/hg.py b/libbe/hg.py index 27cbb79..52f8a96 100644 --- a/libbe/hg.py +++ b/libbe/hg.py @@ -13,12 +13,15 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import sys import os import re import unittest import doctest -from rcs import RCS, RCStestCase, CommandError, SettingIDnotSupported +import rcs +from rcs import RCS def new(): return Hg() @@ -49,7 +52,7 @@ class Hg(RCS): standard Mercurial. http://www.selenic.com/mercurial/wiki/index.cgi/ConfigExtension """ - raise SettingIDnotSupported + raise rcs.SettingIDnotSupported def _rcs_add(self, path): self._u_invoke_client("add", path) def _rcs_remove(self, path): @@ -79,8 +82,8 @@ class Hg(RCS): revision = match.groups()[0] return revision -class HgTestCase(RCStestCase): - Class = Hg + +rcs.make_rcs_testcase_subclasses(Hg, sys.modules[__name__]) -unitsuite = unittest.TestLoader().loadTestsFromTestCase(HgTestCase) +unitsuite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) suite = unittest.TestSuite([unitsuite, doctest.DocTestSuite()]) |