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

Commit 56b29b5

Browse files
committed
Fix broken unit tests caused by CheckVersion() change.
1 parent 41a9092 commit 56b29b5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

feedvalidator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,15 +601,14 @@ def RunValidation(feed, options, problems):
601601
return schedule, 0, other_problems_string
602602

603603

604-
def CheckVersion(latest_version=''):
604+
def CheckVersion(latest_version=None):
605605
"""
606606
Check there is newer version of this project.
607607
608608
Codes are based on http://www.voidspace.org.uk/python/articles/urllib2.shtml
609609
Already got permission from the copyright holder.
610610
"""
611611
current_version = transitfeed.__version__
612-
latest_version = None
613612
if not latest_version:
614613
timeout = 20
615614
socket.setdefaulttimeout(timeout)

test/testfeedvalidator.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,7 @@ def testEmptyIsReturned(self):
466466
class MockURLOpen:
467467
"""Pretend to be a urllib2.urlopen suitable for testing."""
468468
def mockedConnectSuccess(self, request):
469-
return StringIO.StringIO('<li><a href="transitfeed-1.0.0/">transitfeed-'
470-
'1.0.0/</a></li><li><a href=transitfeed-100.0.1/>'
471-
'transitfeed-100.0.1/</a></li>')
469+
return StringIO.StringIO('latest_version=100.0.1')
472470

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

0 commit comments

Comments
 (0)