Skip to content

Commit 79a2215

Browse files
committed
Added support for comparing only a subset pages via URLPREFIX variable
- Legacy-Id: 1703
1 parent 8e4416b commit 79a2215

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

test/compare_096_1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import sys
44
import os
5+
import re
56

67
# Warning: The following code assumes that this file is located in the svn
78
# checkout directory, and hasn't been moved:
89
ietfpath = os.path.abspath(__file__.rsplit("/", 1)[0] + "/..")
910
sys.path.append(ietfpath)
1011

1112
os.environ["DJANGO_SETTINGS_MODULE"] = "ietf.settings"
13+
prefixes = os.environ.get("URLPREFIX", "").split()
1214

1315
from difflib import unified_diff
1416
import urllib2 as urllib
@@ -28,6 +30,14 @@ def fetch(url):
2830
return html
2931

3032
for codes, url, master in testtuples:
33+
if prefixes:
34+
match = False
35+
for prefix in prefixes:
36+
if re.match(prefix, url[1:]):
37+
match = True
38+
break
39+
if not match:
40+
continue
3141
print "Testing "+url
3242
if not "200" in codes:
3343
print " Skipping, not 200 code"

0 commit comments

Comments
 (0)