/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/tests/test_remote.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-09-12 02:50:00 UTC
  • mfrom: (7103.1.3 parse-git-error)
  • Revision ID: breezy.the.bot@gmail.com-20180912025000-dzxshqqn5dqci1t6
Improve error parsing for git repositories a bit.

Merged from https://code.launchpad.net/~jelmer/brz/parse-git-error/+merge/354724

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    DivergedBranches,
30
30
    NotBranchError,
31
31
    NoSuchTag,
 
32
    PermissionDenied,
32
33
    )
33
34
 
34
35
from ...tests import (
41
42
from ..remote import (
42
43
    split_git_url,
43
44
    parse_git_error,
 
45
    HeadUpdateFailed,
 
46
    RemoteGitError,
44
47
    RemoteGitBranchFormat,
45
48
    )
46
49
 
79
82
 
80
83
    def test_unknown(self):
81
84
        e = parse_git_error("url", "foo")
82
 
        self.assertIsInstance(e, BzrError)
 
85
        self.assertIsInstance(e, RemoteGitError)
83
86
 
84
87
    def test_notbrancherror(self):
85
88
        e = parse_git_error("url", "\n Could not find Repository foo/bar")
86
89
        self.assertIsInstance(e, NotBranchError)
87
90
 
 
91
    def test_notbrancherror_github(self):
 
92
        e = parse_git_error("url", "Repository not found.\n")
 
93
        self.assertIsInstance(e, NotBranchError)
 
94
 
 
95
    def test_head_update(self):
 
96
        e = parse_git_error("url", "HEAD failed to update\n")
 
97
        self.assertIsInstance(e, HeadUpdateFailed)
 
98
 
 
99
    def test_permission_dnied(self):
 
100
        e = parse_git_error(
 
101
            "url",
 
102
            "access denied or repository not exported: /debian/altermime.git")
 
103
        self.assertIsInstance(e, PermissionDenied)
 
104
 
88
105
 
89
106
class TestRemoteGitBranchFormat(TestCase):
90
107