aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-11-28 08:13:13 +0100
committerGuido Günther <agx@sigxcpu.org>2017-11-28 08:13:13 +0100
commit57c099e9259a34c274836f96024bbb84563486d4 (patch)
tree2c21dc43cd6a61bcffc14ee9b0d50b9d29c0f1ef /tests
parent45a0652fa344e63b00970202003ff63ecfa9a2d9 (diff)
DebianSource: add test for workdir != toplevel debian dir
Gbp-Dch: Ignore
Diffstat (limited to 'tests')
-rw-r--r--tests/15_test_DebianSource.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/15_test_DebianSource.py b/tests/15_test_DebianSource.py
index 06ffb78b..809feaac 100644
--- a/tests/15_test_DebianSource.py
+++ b/tests/15_test_DebianSource.py
@@ -118,3 +118,26 @@ class TestDebianSource(testutils.DebianGitTestRepo):
source = DebianSource('.')
self.assertIsNotNone(source.control)
self.assertEquals(source.control.name, "foo")
+
+ def test_cur_dir_not_toplevel(self):
+ """
+ Check if we can parse files if workdir != debian toplevel dir
+ """
+ os.makedirs('debian/')
+ with open('debian/changelog', 'w') as f:
+ f.write("""foo (0.2.3) unstable; urgency=low
+
+ * git doesn't like '~' in tag names so replace this with a dot when tagging
+
+ -- Guido Guenther <agx@sigxcpu.org> Mon, 2 Oct 2006 18:30:20 +0200
+""")
+ with open('debian/control', 'w') as f:
+ f.write("Source: foo")
+ os.chdir('debian/')
+ source = DebianSource('..')
+ self.assertEquals(source.changelog.name, "foo")
+ self.assertEquals(source.control.name, "foo")
+
+ source = DebianSource(os.path.abspath('..'))
+ self.assertEquals(source.changelog.name, "foo")
+ self.assertEquals(source.control.name, "foo")