File: 29_test_gbp_clone.py

package info (click to toggle)
git-buildpackage 0.9.39
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,464 kB
  • sloc: python: 18,427; xml: 8,746; sh: 731; makefile: 139
file content (34 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# vim: set fileencoding=utf-8 :
from gbp.scripts.clone import vcs_git_url

import unittest
from unittest.mock import patch

from . testutils import skip_without_cmd


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

"""

    @skip_without_cmd('dpkg')
    @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/')