Browse Source

Skip test_readme_5() if web query fails.

tags/v0.2
Ben Kurtovic 11 years ago
parent
commit
5ca6f6c755
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      tests/test_docs.py

+ 4
- 1
tests/test_docs.py View File

@@ -113,7 +113,10 @@ class TestDocs(unittest.TestCase):
title = "Test" title = "Test"
data = {"action": "query", "prop": "revisions", "rvlimit": 1, data = {"action": "query", "prop": "revisions", "rvlimit": 1,
"rvprop": "content", "format": "json", "titles": title} "rvprop": "content", "format": "json", "titles": title}
raw = urllib.urlopen(url1, urllib.urlencode(data)).read()
try:
raw = urllib.urlopen(url1, urllib.urlencode(data)).read()
except IOError:
self.skipTest("cannot continue because of unsuccessful web call")
res = json.loads(raw) res = json.loads(raw)
text = res["query"]["pages"].values()[0]["revisions"][0]["*"] text = res["query"]["pages"].values()[0]["revisions"][0]["*"]
expected = urllib.urlopen(url2.format(title)).read().decode("utf8") expected = urllib.urlopen(url2.format(title)).read().decode("utf8")


Loading…
Cancel
Save