Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Fix broken unit tests caused by CheckVersion() change.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdferris committed Sep 26, 2014
1 parent 41a9092 commit 56b29b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions feedvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,15 +601,14 @@ def RunValidation(feed, options, problems):
return schedule, 0, other_problems_string


def CheckVersion(latest_version=''):
def CheckVersion(latest_version=None):
"""
Check there is newer version of this project.
Codes are based on http://www.voidspace.org.uk/python/articles/urllib2.shtml
Already got permission from the copyright holder.
"""
current_version = transitfeed.__version__
latest_version = None
if not latest_version:
timeout = 20
socket.setdefaulttimeout(timeout)
Expand Down
4 changes: 1 addition & 3 deletions test/testfeedvalidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ def testEmptyIsReturned(self):
class MockURLOpen:
"""Pretend to be a urllib2.urlopen suitable for testing."""
def mockedConnectSuccess(self, request):
return StringIO.StringIO('<li><a href="transitfeed-1.0.0/">transitfeed-'
'1.0.0/</a></li><li><a href=transitfeed-100.0.1/>'
'transitfeed-100.0.1/</a></li>')
return StringIO.StringIO('latest_version=100.0.1')

def mockedPageNotFound(self, request):
raise HTTPError(request.get_full_url(), 404, 'Not Found',
Expand Down

0 comments on commit 56b29b5

Please sign in to comment.