mirror of https://github.com/pypa/pip
Make VersionControl.make_rev_args() a class method.
This commit is contained in:
parent
3ba489864b
commit
e1e94530ad
|
@ -337,7 +337,8 @@ class VersionControl(object):
|
|||
url = urllib_parse.urlunsplit((scheme, netloc, path, query, ''))
|
||||
return url, rev, user_pass
|
||||
|
||||
def make_rev_args(self, username, password):
|
||||
@classmethod
|
||||
def make_rev_args(cls, username, password):
|
||||
"""
|
||||
Return the RevOptions "extra arguments" to use in obtain().
|
||||
"""
|
||||
|
|
|
@ -113,7 +113,8 @@ class Subversion(VersionControl):
|
|||
url = 'svn+' + url
|
||||
return url, rev, user_pass
|
||||
|
||||
def make_rev_args(self, username, password):
|
||||
@classmethod
|
||||
def make_rev_args(cls, username, password):
|
||||
extra_args = []
|
||||
if username:
|
||||
extra_args += ['--username', username]
|
||||
|
|
|
@ -340,7 +340,7 @@ def test_git__make_rev_args(username, password, expected):
|
|||
"""
|
||||
Test VersionControl.make_rev_args().
|
||||
"""
|
||||
actual = Git().make_rev_args(username, password)
|
||||
actual = Git.make_rev_args(username, password)
|
||||
assert actual == expected
|
||||
|
||||
|
||||
|
@ -353,7 +353,7 @@ def test_subversion__make_rev_args(username, password, expected):
|
|||
"""
|
||||
Test Subversion.make_rev_args().
|
||||
"""
|
||||
actual = Subversion().make_rev_args(username, password)
|
||||
actual = Subversion.make_rev_args(username, password)
|
||||
assert actual == expected
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue