summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-03-22 13:47:44 +0100
committerGuido Günther <agx@sigxcpu.org>2011-04-17 15:45:51 +0200
commit5b63e3f2c780d1d235ee417344bc8ef50984578c (patch)
treef5c55e00321bc86379c84aa5e983bf4699bee210
parent671046207e7475476758ef31b3e9063deb947a5a (diff)
tests: add doctests for gbp.deb.orig_file()
-rw-r--r--gbp/deb.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/gbp/deb.py b/gbp/deb.py
index 7d612d3b..930e6264 100644
--- a/gbp/deb.py
+++ b/gbp/deb.py
@@ -242,7 +242,14 @@ def parse_changelog(contents=None, filename=None):
def orig_file(cp, compression):
- "The name of the orig.tar.gz belonging to changelog cp"
+ """
+ The name of the orig file belonging to changelog cp
+
+ >>> orig_file({'Source': 'foo', 'Upstream-Version': '1.0'}, "bzip2")
+ 'foo_1.0.orig.tar.bz2'
+ >>> orig_file({'Source': 'bar', 'Upstream-Version': '0.0~git1234'}, "xz")
+ 'bar_0.0~git1234.orig.tar.xz'
+ """
ext = compressor_opts[compression][1]
return "%s_%s.orig.tar.%s" % (cp['Source'], cp['Upstream-Version'], ext)