diff --git a/ietf/tests.py b/ietf/tests.py index cbad9fba4..134aaa998 100644 --- a/ietf/tests.py +++ b/ietf/tests.py @@ -140,7 +140,7 @@ def module_setup(module): for item in os.listdir(testdir): path = testdir + "/" + item if item.startswith("generic-") and os.path.isfile(path): - chunk = filetext(path).strip() + chunk = filetext(path).rstrip() chunk = re.sub(r"([\[\]().|+*?])", r"\\\1", chunk) # @@ -27,0 \+23,1 @@ chunk = re.sub(r"(?m)^@@ -\d+,(\d+) \\\+\d+,(\d+) @@$", r"@@ -\d+,\1 \+\d+,\2 @@", chunk) @@ -310,30 +310,36 @@ class UrlTestCase(TestCase): for regex in module.ignores[ignore]: testtext = re.sub(regex, "", testtext) goodtext = re.sub(regex, "", goodtext) - testtext = lines(testtext) - goodtext = lines(goodtext) + #log("Checking text: %s" % testtext[:96]) + testtext = lines(testtext.strip()) + goodtext = lines(goodtext.strip()) if "sort" in codes: testtext = sorted(testtext) while testtext and not testtext[0]: del testtext[0] + while testtext and not testtext[-1]: + del testtext[-1] goodtext = sorted(goodtext) while goodtext and not goodtext[0]: del goodtext[0] + while goodtext and not goodtext[-1]: + del goodtext[-1] if testtext == goodtext: note("OK cmp %s" % (url)) else: contextlines = 0 difflist = list(unified_diff(goodtext, testtext, master, url, "", "", contextlines, lineterm="")) diff = "\n".join(difflist) + log("Checking diff: %s" % diff[:96]) keys = module.diffchunks.keys() keys.sort for key in keys: chunk = module.diffchunks[key] if chunk: if not re.search(chunk, diff): - log("No match: %s" % chunk[:32]) + log("No match: %s" % chunk[:96]) while re.search(chunk, diff): - log("Found chunk: %s" % chunk[:32]) + log("Found chunk: %s" % chunk[:96]) diff = re.sub(chunk, "", diff) if len(diff.strip().splitlines()) == 2: # only the initial 2 lines of the diff remains -- @@ -355,8 +361,8 @@ class UrlTestCase(TestCase): note("Failed diff: %s" % (url)) else: note("Diff: %s" % (url)) - print "\n".join(difflist[:100]) - if len(difflist) > 100: + print "\n".join(diff.split("\n")[:100]) + if len(diff.split("\n")) > 100: print "... (skipping %s lines of diff)" % (len(difflist)-100) else: note("OK cmp %s" % (url)) diff --git a/test/diff/_ipr_ipr-657_ b/test/diff/_ipr_ipr-657_ index 83aaba791..41f0d03bd 100644 --- a/test/diff/_ipr_ipr-657_ +++ b/test/diff/_ipr_ipr-657_ @@ -11,6 +11,6 @@ @@ -49,1 +50,1 @@ -IETF Participant in Section III above) +the Contact Information above) -@@ -58,0 +59,2 @@ +@@ -58,0 +59,3 @@ +VI. Other Notes: +No information submitted \ No newline at end of file diff --git a/test/diff/_ipr_ipr-795_ b/test/diff/_ipr_ipr-795_ index 4393c85c8..494746677 100644 --- a/test/diff/_ipr_ipr-795_ +++ b/test/diff/_ipr_ipr-795_ @@ -13,7 +13,7 @@ +the section "After the panel" from: +http://www.proper.com/lookit/hash-futures-panel-notes.html +The patent itself is available from: -@@ -49,1 +48,2 @@ +@@ -49,1 +48,3 @@ -covered. +covered: +No information submitted \ No newline at end of file diff --git a/test/diff/_ipr_ipr-834_ b/test/diff/_ipr_ipr-834_ index 4c41b2c1d..768154ae1 100644 --- a/test/diff/_ipr_ipr-834_ +++ b/test/diff/_ipr_ipr-834_ @@ -22,6 +22,6 @@ @@ -70,1 +70,1 @@ -IETF Participant in Section III above) +the Contact Information above) -@@ -79,0 +79,2 @@ +@@ -79,0 +79,3 @@ +VIII. Other Notes: +No information submitted \ No newline at end of file diff --git a/test/diff/_ipr_new-generic_ b/test/diff/_ipr_new-generic_ index 264bc9c1b..099d738f7 100644 --- a/test/diff/_ipr_new-generic_ +++ b/test/diff/_ipr_new-generic_ @@ -72,4 +72,5 @@ +Same as in Section II above: @@ -86,1 +90,1 @@ -VI. Other Note(s): -+VI. Other Notes: \ No newline at end of file ++VI. Other Notes: +@@ -88,0 +92,1 @@ \ No newline at end of file diff --git a/test/diff/_ipr_new-specific_ b/test/diff/_ipr_new-specific_ index 12059efe1..a6fbd2e48 100644 --- a/test/diff/_ipr_new-specific_ +++ b/test/diff/_ipr_new-specific_ @@ -70,4 +70,5 @@ +Same as in Section III above: @@ -102,1 +105,1 @@ -VIII. Other Note(s): -+VIII. Other Notes: \ No newline at end of file ++VIII. Other Notes: +@@ -104,0 +107,1 @@ \ No newline at end of file diff --git a/test/diff/_ipr_new-third-party_ b/test/diff/_ipr_new-third-party_ index 8be796bba..b6b363f69 100644 --- a/test/diff/_ipr_new-third-party_ +++ b/test/diff/_ipr_new-third-party_ @@ -37,4 +37,5 @@ +NO @@ -48,1 +50,1 @@ -covered. -+covered: \ No newline at end of file ++covered: +@@ -50,0 +52,1 @@ \ No newline at end of file diff --git a/test/diff/_ipr_search__rfc_search=1034&option=rfc_search b/test/diff/_ipr_search__rfc_search=1034&option=rfc_search index 04ce96ec0..90cf6ace6 100644 --- a/test/diff/_ipr_search__rfc_search=1034&option=rfc_search +++ b/test/diff/_ipr_search__rfc_search=1034&option=rfc_search @@ -1,26 +1,26 @@ --- https://datatracker.ietf.org/public/ipr_search.cgi?option=rfc_search&rfc_search=1034 +++ /ipr/search/?rfc_search=1034&option=rfc_search -@@ -149,1 +149,1 @@ +@@ -149,1 +150,1 @@ -Search result on RFC1035, "Domain names - implementation and specification", that was updated by RFC3658, "Delegation Signer Resource Record" +Search result on RFC1035, "Domain names - implementation and specification", that was updated by RFC4033, "DNS Security Introduction and Requirements" -@@ -172,2 +172,2 @@ +@@ -172,2 +173,2 @@ -Search result on RFC2181, "Clarifications to the DNS Specification", that updated RFC1035, "Domain names - implementation and specification" -Search result on RFC2308, "Negative Caching of DNS Queries (DNS NCACHE)", that updated RFC1035, "Domain names - implementation and specification" +Search result on RFC2181, "Clarifications to the DNS Specification", that was updated by RFC4035, "Protocol Modifications for the DNS Security Extensions" +Search result on RFC2308, "Negative Caching of DNS Queries (DNS NCACHE)", that was updated by RFC4035, "Protocol Modifications for the DNS Security Extensions" -@@ -189,2 +189,2 @@ +@@ -189,2 +190,2 @@ -Search result on RFC3008, "Domain Name System Security (DNSSEC) Signing Authority", that was obsoleted by RFC4033, "DNS Security Introduction and Requirements" -Search result on RFC3090, "DNS Security Extension Clarification on Zone Status", that was obsoleted by RFC4035, "Protocol Modifications for the DNS Security Extensions" +Search result on RFC3008, "Domain Name System Security (DNSSEC) Signing Authority", that was updated by RFC3658, "Delegation Signer Resource Record" +Search result on RFC3090, "DNS Security Extension Clarification on Zone Status", that was updated by RFC3658, "Delegation Signer Resource Record" -@@ -202,2 +202,2 @@ +@@ -202,2 +203,2 @@ -Search result on RFC3658, "Delegation Signer Resource Record", that updated RFC3090, "DNS Security Extension Clarification on Zone Status" -Search result on RFC3755, "Legacy Resolver Compatibility for Delegation Signer", that updated RFC3658, "Delegation Signer Resource Record" +Search result on RFC3658, "Delegation Signer Resource Record", that was updated by RFC3755, "Legacy Resolver Compatibility for Delegation Signer" +Search result on RFC3755, "Legacy Resolver Compatibility for Delegation Signer", that was updated by RFC3845, "DNS Security (DNSSEC) NextSECure (NSEC) RDATA Format" -@@ -205,1 +205,1 @@ +@@ -205,1 +206,1 @@ -Search result on RFC3845, "DNS Security (DNSSEC) NextSECure (NSEC) RDATA Format", that updated RFC3755, "Legacy Resolver Compatibility for Delegation Signer" +Search result on RFC3845, "DNS Security (DNSSEC) NextSECure (NSEC) RDATA Format", that was obsoleted by RFC4035, "Protocol Modifications for the DNS Security Extensions" -@@ -207,1 +207,1 @@ +@@ -207,1 +208,1 @@ -Search result on RFC4034, "Resource Records for the DNS Security Extensions", that obsoleted RFC3008, "Domain Name System Security (DNSSEC) Signing Authority" +Search result on RFC4034, "Resource Records for the DNS Security Extensions", that updated RFC2136, "Dynamic Updates in the Domain Name System (DNS UPDATE)" \ No newline at end of file diff --git a/test/diff/generic-diff_A-hat b/test/diff/generic-diff_A-hat index 751fce138..239703e75 100644 --- a/test/diff/generic-diff_A-hat +++ b/test/diff/generic-diff_A-hat @@ -1,3 +1,4 @@ + @@ -16,1 +16,1 @@ -request makes it into the ID tracker.)  A document in this state has +request makes it into the ID tracker.) A document in this state has diff --git a/test/diff/generic-diff_footer_1 b/test/diff/generic-diff_footer_1 index 35cc55f63..2df9f64c2 100644 --- a/test/diff/generic-diff_footer_1 +++ b/test/diff/generic-diff_footer_1 @@ -1,2 +1,3 @@ + @@ -104,0 +104,1 @@ +Made with djangov0.98-dev, Tue, 26 Jun 2007 - webmaster@ietf.org \ No newline at end of file diff --git a/test/diff/generic-diff_footer_2 b/test/diff/generic-diff_footer_2 index aec89b435..49fae97c2 100644 --- a/test/diff/generic-diff_footer_2 +++ b/test/diff/generic-diff_footer_2 @@ -1 +1,2 @@ + +Made with djangov0.98-dev, Tue, 26 Jun 2007 - webmaster@ietf.org \ No newline at end of file diff --git a/test/diff/generic-diff_footer_3 b/test/diff/generic-diff_footer_3 new file mode 100644 index 000000000..114c96f4f --- /dev/null +++ b/test/diff/generic-diff_footer_3 @@ -0,0 +1,2 @@ + ++Made with djangov, - webmaster@ietf.org \ No newline at end of file diff --git a/test/diff/generic-diff_missing_page-produced-by_1 b/test/diff/generic-diff_missing_page-produced-by_1 index 476cde167..41d12f9ed 100644 --- a/test/diff/generic-diff_missing_page-produced-by_1 +++ b/test/diff/generic-diff_missing_page-produced-by_1 @@ -1,3 +1,4 @@ + @@ -162,1 +159,0 @@ -Did you find a bug? Let us know. @@ -164,5 +160,0 @@