Skip to content

Commit 6d28eb1

Browse files
committed
Replaced the handcoded agenda-83.txt test with one using the testurl
framework, moving the known-good master to a name matching the others mentioned in testurl.list. - Legacy-Id: 6438
1 parent e516dc7 commit 6d28eb1

7 files changed

Lines changed: 19 additions & 5341 deletions

File tree

ietf/meeting/tests/agenda-83-utc-output.html

Lines changed: 0 additions & 5306 deletions
This file was deleted.

ietf/meeting/tests/agenda-83-utc.html.good

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ img.hidden { display: none; }
100100

101101

102102
<div id="ietf-login" class="noprint">
103-
<a href="https://grenache.tools.ietf.org:31416/accounts/login/?next=/meeting/83/agenda-utc.html" rel="nofollow">Sign In</a>
103+
<a href="https://testserver/accounts/login/?next=/meeting/83/agenda-utc.html" rel="nofollow">Sign In</a>
104104
</div>
105105

106106

107-
<table style="margin-left:8px;margin-top:8px;" width="98%;">
107+
108+
<table style="margin-left:8px;margin-top:8px; width:98%;" id="ietf_menubar">
108109
<tr valign="top">
109110
<td style="width:130px;padding-right:8px;" class="noprint">
110111
<div class="ietf-navbar">
@@ -304,7 +305,7 @@ img.hidden { display: none; }
304305

305306

306307

307-
<li><a href="http://grenache.tools.ietf.org:31416/accounts/login/?next=/meeting/83/agenda-utc.html" rel="nofollow">Sign in to track drafts</a></li>
308+
<li><a href="http://testserver/accounts/login/?next=/meeting/83/agenda-utc.html" rel="nofollow">Sign in to track drafts</a></li>
308309

309310

310311

@@ -11698,7 +11699,7 @@ You can customize the agenda below to show only selected working group sessions.
1169811699

1169911700

1170011701

11701-
<script type="text/javascript" src="/js/lib/jquery-1.5.1.min.js"></script>
11702+
<script type="text/javascript" src="/js/lib/jquery-1.8.2.min.js"></script>
1170211703
<script type="text/javascript" src="/js/yui/yui-20100305.js"></script>
1170311704
<script type="text/javascript">
1170411705
//<![CDATA[
@@ -11713,11 +11714,12 @@ YAHOO.util.Event.onContentReady("wgs", function () {
1171311714

1171411715

1171511716

11716-
11717-
</div>
11717+
1171811718
<div id="ietf-extras"></div>
11719+
1171911720
</td></tr></table>
1172011721

1172111722

1172211723

11724+
1172311725
</body></html>

ietf/meeting/tests/agenda-83.html.good

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ img.hidden { display: none; }
9999
</div>
100100

101101

102-
<table style="margin-left:8px;margin-top:8px;" width="98%;">
102+
103+
<table style="margin-left:8px;margin-top:8px; width:98%;" id="ietf_menubar">
103104
<tr valign="top">
104105
<td style="width:130px;padding-right:8px;" class="noprint">
105106
<div class="ietf-navbar">
@@ -11643,11 +11644,12 @@ YAHOO.util.Event.onContentReady("wgs", function () {
1164311644

1164411645

1164511646

11646-
11647-
</div>
11647+
1164811648
<div id="ietf-extras"></div>
11649+
1164911650
</td></tr></table>
1165011651

1165111652

1165211653

11654+
1165311655
</body></html>
File renamed without changes.

ietf/meeting/tests/meetingurls.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12

23
from ietf.utils.test_utils import SimpleUrlTestCase, canonicalize_feed
34

@@ -7,6 +8,8 @@ def testUrls(self):
78
def doCanonicalize(self, url, content):
89
if url.startswith("/feed/"):
910
return canonicalize_feed(content)
10-
else:
11-
return content
11+
if "agenda" in url:
12+
content = re.sub("<!-- v.*-->","", content)
13+
content = re.sub('<a href="/release/.*?</a>','', content)
14+
return content
1215

ietf/meeting/tests/testurl.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
200 /meeting/83/agenda.ics?APP,-~Other,-~Plenary
2323
200 /meeting/83/agenda.html ietf/meeting/tests/agenda-83.html.good
2424
200 /meeting/83/agenda-utc.html ietf/meeting/tests/agenda-83-utc.html.good
25+
200 /meeting/83/agenda.txt ietf/meeting/tests/agenda-83.txt.good
2526
200,skipdiff /meeting/83/rooms
2627
200,skipdiff /meeting/83/room/206.json
2728
200,skipdiff /meeting/83/timeslots

ietf/meeting/tests/view.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,6 @@ def test_agenda83txt(self):
3535
out.close()
3636
self.assertEqual(resp.content, agenda83txt, "The /meeting/83/agenda.txt page changed.\nThe newly generated agenda has been written to file: %s" % fn)
3737

38-
def test_agenda83utc(self):
39-
# verify that the generated html has not changed.
40-
import io
41-
agenda83utcio = open("%s/meeting/tests/agenda-83-utc-output.html" % BASE_DIR, "r")
42-
agenda83utc_valid = agenda83utcio.read(); # read entire file
43-
resp = self.client.get('/meeting/83/agenda-utc.html')
44-
# both agendas will have a software version indication inside a
45-
# comment. This will change. Remove comments before comparing.
46-
agenda83utc_valid = re.sub("<!-- v.*-->","", agenda83utc_valid)
47-
agenda83utc_valid = re.sub('<a href="/release/.*?</a>','', agenda83utc_valid)
48-
49-
agenda83utc_response = resp.content
50-
agenda83utc_response = re.sub("<!-- v.*-->","", agenda83utc_response)
51-
agenda83utc_response = re.sub('<a href="/release/.*</a>','', agenda83utc_response)
52-
53-
fn = ""
54-
# to capture new output (and check it for correctness)
55-
if agenda83utc_valid != agenda83utc_response:
56-
fn = "%s/meeting/tests/agenda-83-utc-output-out.html" % BASE_DIR
57-
out = open(fn, "w")
58-
out.write(resp.content)
59-
out.close()
60-
self.assertEqual(agenda83utc_valid, agenda83utc_response, "The /meeting/83/agenda-utc.html page changed.\nThe newly generated agenda has been written to file: %s" % fn)
61-
6238
def test_nameOfClueWg(self):
6339
clue_session = Session.objects.get(pk=2194)
6440
self.assertEqual(clue_session.short_name, "clue")

0 commit comments

Comments
 (0)