aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Guenther <agx@sigxcpu.org>2008-04-14 14:13:51 +0200
committerGuido Guenther <agx@sigxcpu.org>2008-04-14 14:13:51 +0200
commita793e8c5092955fb59647b0bf51da0a6d626d869 (patch)
tree2c74411196339ed9217eb7ba183b1a2ee231e576
parenta8992fe33881dcfff7b9cf04448eaa54f6afc219 (diff)
add _test()
to run doctests easily
-rw-r--r--gbp/command_wrappers.py10
-rw-r--r--gbp/deb_utils.py8
-rw-r--r--gbp/git_utils.py10
3 files changed, 26 insertions, 2 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py
index 91e476e1..26064cda 100644
--- a/gbp/command_wrappers.py
+++ b/gbp/command_wrappers.py
@@ -245,4 +245,12 @@ def copy_from(orig_dir, filters=[]):
raise GbpError, "Cannot copy files, pipe failed."
return [ os.path.normpath(f) for f in files if files ]
-# vim:et:ts=4:sw=4:
+
+def _test():
+ import doctest
+ doctest.testmod()
+
+if __name__ == '__main__':
+ _test()
+
+# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
diff --git a/gbp/deb_utils.py b/gbp/deb_utils.py
index 2e7b7078..d6116fff 100644
--- a/gbp/deb_utils.py
+++ b/gbp/deb_utils.py
@@ -86,4 +86,12 @@ def unpack_orig(archive, tmpdir, filters):
raise GbpError
return unpackArchive.dir
+
+def _test():
+ import doctest
+ doctest.testmod()
+
+if __name__ == '__main__':
+ _test()
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·:
diff --git a/gbp/git_utils.py b/gbp/git_utils.py
index af55c207..c95dd316 100644
--- a/gbp/git_utils.py
+++ b/gbp/git_utils.py
@@ -1,6 +1,6 @@
# vim: set fileencoding=utf-8 :
#
-# (C) 2006,2007 Guido Guenther <agx@sigxcpu.org>
+# (C) 2006,2007,2008 Guido Guenther <agx@sigxcpu.org>
"""provides some git repository related helpers"""
import subprocess
@@ -152,4 +152,12 @@ def rfc822_date_to_git(rfc822_date):
tz = d.strftime("%z")
return '%d %s' % (seconds, tz)
+
+def _test():
+ import doctest
+ doctest.testmod()
+
+if __name__ == '__main__':
+ _test()
+
# vim:et:ts=4:sw=4:et:sts=4:ai:set list listchars=tab\:»·,trail\:·: