Closed hugovk closed 8 years ago
That test shows that the PyPI search for "" is returning "". Could this be handled with just an if statement?
def normalize(name):
# (docstring omitted)
if name == "":
return ""
# ...other code
return normalize_name
Yes, that's one way.
Would that be okay - Do you want me to work this into PR #50 ?
Yes, that'd be okay, but put it in another PR: it's better to keep distinct things in each PR, it makes them easier to discuss and in general the simpler ones can get merged quicker.
Good point, created PR #52 (also fix the test class name / remove the TODO)
test_empty
has a TODO that needs fixing:So right now
normalize
is looking up on PyPI for a package called "" and not finding it. The empty string is a special case; there's no point looking for anything so it'd make more sense to validate and to return something sensible right away.