Skip to content

Commit

Permalink
Fix mock
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Apr 8, 2019
1 parent 4dfda6b commit 2882042
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/unit/test_unit_outdated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import collections
import datetime
import os
import sys
Expand All @@ -13,6 +12,14 @@
from pip._internal.utils import outdated


class MockFoundCandidates(object):
def __init__(self, best):
self._best = best

def get_best(self):
return self._best


class MockPackageFinder(object):

BASE_URL = 'https://pypi.org/simple/pip-{0}.tar.gz'
Expand All @@ -29,10 +36,8 @@ class MockPackageFinder(object):
def __init__(self, *args, **kwargs):
pass

def find_candidates(self, project_name, specifier):
return collections.namedtuple("FoundCandidates", "best")(
best=self.INSTALLATION_CANDIDATES[0],
)
def find_candidates(self, project_name):
return MockFoundCandidates(self.INSTALLATION_CANDIDATES[0])


class MockDistribution(object):
Expand Down

0 comments on commit 2882042

Please sign in to comment.