From b75ee89865c811f886d18d5602c81ce57f4a92b8 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 20 Mar 2018 11:04:12 +0000 Subject: [PATCH] Added a test case for reference extraction. - Legacy-Id: 14869 --- ietf/submit/test_submission.txt | 33 +++++++++++++++++++++++++++++++++ ietf/submit/tests.py | 15 +++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/ietf/submit/test_submission.txt b/ietf/submit/test_submission.txt index 17c206a75..e5f3a9f13 100644 --- a/ietf/submit/test_submission.txt +++ b/ietf/submit/test_submission.txt @@ -178,6 +178,35 @@ Table of Contents No new registrations for IANA. + [RFC8175] is mentioned here in order to give the reference + classification code a chance to mess up. + + +6. References + +6.1. Normative References + + [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate + Requirement Levels", BCP 14, RFC 2119, + DOI 10.17487/RFC2119, March 1997, + . + + [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC + 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, + May 2017, . + +6.2. Informative References + + [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for + Writing an IANA Considerations Section in RFCs", BCP 26, + RFC 8126, DOI 10.17487/RFC8126, June 2017, + . + + [RFC8175] Ratliff, S., Jury, S., Satterwhite, D., Taylor, R., and B. + Berry, "Dynamic Link Exchange Protocol (DLEP)", RFC 8175, + DOI 10.17487/RFC8175, June 2017, + . + Author's Address %(author)s @@ -190,6 +219,10 @@ Author's Address +Appendix A. Comments + + [RFC8174] is mentioned here just to give the reference classification + code a chance to mess up. diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index bcff595ba..458e30114 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -35,6 +35,7 @@ from ietf.utils.mail import outbox, empty_outbox from ietf.utils.models import VersionInfo from ietf.utils.test_data import make_test_data from ietf.utils.test_utils import login_testing_unauthorized, unicontent, TestCase +from ietf.utils.draft import Draft def submission_file(name, rev, group, format, templatename, author=None, email=None, title=None, year=None, ascii=True): @@ -1660,3 +1661,17 @@ class ApiSubmitTests(TestCase): r, author, name = self.post_submission('00', year="1900") expected = "Document date must be within 3 days of submission date" self.assertContains(r, expected, status_code=400) + +class RefsTests(TestCase): + + def test_draft_refs_identification(self): + + group = None + file, __ = submission_file('draft-some-subject', '00', group, 'txt', "test_submission.txt", ) + draft = Draft(file.read().decode('utf-8'), file.name) + refs = draft.get_refs() + self.assertEqual(refs['rfc2119'], 'norm') + self.assertEqual(refs['rfc8174'], 'norm') + self.assertEqual(refs['rfc8126'], 'info') + self.assertEqual(refs['rfc8175'], 'info') +