aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/29_test_gbp_clone.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-04-25 20:22:34 +0200
committerGuido Günther <agx@sigxcpu.org>2017-04-25 22:57:35 +0200
commit1113c9590ca2847f586441e857e3f17698a35020 (patch)
tree4032fb266da48c8a4d2c92c07f43e0c9b5c66ea1 /tests/29_test_gbp_clone.py
parent000f92479367d6245be3bda9a662758009f87d14 (diff)
clone: Add support for pseudo protocols like vcsgit: and github:
to make cloning simpler Closes: #861206
Diffstat (limited to 'tests/29_test_gbp_clone.py')
-rw-r--r--tests/29_test_gbp_clone.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/29_test_gbp_clone.py b/tests/29_test_gbp_clone.py
new file mode 100644
index 00000000..17e958e1
--- /dev/null
+++ b/tests/29_test_gbp_clone.py
@@ -0,0 +1,33 @@
+# vim: set fileencoding=utf-8 :
+from gbp.scripts.clone import vcs_git_url
+
+import os
+import unittest
+from mock import patch
+
+
+class TestGbpClone(unittest.TestCase):
+ show_src = """
+Version: 0.6.22
+Standards-Version: 3.9.4
+Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
+
+Version: 0.8.14
+Standards-Version: 3.9.8
+Vcs-Git: https://git.sigxcpu.org/cgit/git-buildpackage/ -b foo
+
+Version: 0.8.12.2
+Standards-Version: 3.9.8
+Vcs-Git: https://git.sigxcpu.org/cgit/git-buildpackage/
+
+Version: 0.6.0~git20120601
+Standards-Version: 3.9.3
+Vcs-Git: git://honk.sigxcpu.org/git/git-buildpackage.git
+
+"""
+
+ @unittest.skipIf(not os.path.exists('/usr/bin/dpkg'), 'Dpkg not found')
+ @patch('gbp.scripts.clone.apt_showsrc', return_value=show_src)
+ def test_vcs_git_url(self, patch):
+ self.assertEqual(vcs_git_url('git-buildpackage'),
+ 'https://git.sigxcpu.org/cgit/git-buildpackage/')