Change "escape" to "translate" in escape_egg_surname().

This commit is contained in:
Chris Jerdonek 2014-09-24 23:27:22 -07:00 committed by Donald Stufft
parent b88207a36f
commit a2090f3172
3 changed files with 6 additions and 6 deletions

View File

@ -121,7 +121,7 @@ class VersionControl(object):
# See issue #1083 for why this method was introduced:
# https://github.com/pypa/pip/issues/1083
def escape_egg_surname(self, surname):
def translate_egg_surname(self, surname):
# For example, Django has branches of the form "stable/1.7.x".
return surname.replace('/', '_')

View File

@ -179,7 +179,7 @@ class Git(VersionControl):
# It's a tag
name = names_by_commit[current_rev]
full_egg_name = (
'%s-%s' % (egg_project_name, self.escape_egg_surname(name))
'%s-%s' % (egg_project_name, self.translate_egg_surname(name))
)
else:
full_egg_name = '%s-dev' % egg_project_name

View File

@ -39,11 +39,11 @@ def test_git_get_src_requirements():
])
def test_escape_egg_surname():
def test_translate_egg_surname():
vc = VersionControl()
assert vc.escape_egg_surname("foo") == "foo"
assert vc.escape_egg_surname("foo/bar") == "foo_bar"
assert vc.escape_egg_surname("foo/1.2.3") == "foo_1.2.3"
assert vc.translate_egg_surname("foo") == "foo"
assert vc.translate_egg_surname("foo/bar") == "foo_bar"
assert vc.translate_egg_surname("foo/1.2.3") == "foo_1.2.3"
def test_bazaar_simple_urls():