Skip to content

Commit b75ee89

Browse files
committed
Added a test case for reference extraction.
- Legacy-Id: 14869
1 parent c896138 commit b75ee89

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

ietf/submit/test_submission.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,35 @@ Table of Contents
178178

179179
No new registrations for IANA.
180180

181+
[RFC8175] is mentioned here in order to give the reference
182+
classification code a chance to mess up.
183+
184+
185+
6. References
186+
187+
6.1. Normative References
188+
189+
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
190+
Requirement Levels", BCP 14, RFC 2119,
191+
DOI 10.17487/RFC2119, March 1997,
192+
<https://www.rfc-editor.org/info/rfc2119>.
193+
194+
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
195+
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
196+
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
197+
198+
6.2. Informative References
199+
200+
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
201+
Writing an IANA Considerations Section in RFCs", BCP 26,
202+
RFC 8126, DOI 10.17487/RFC8126, June 2017,
203+
<https://www.rfc-editor.org/info/rfc8126>.
204+
205+
[RFC8175] Ratliff, S., Jury, S., Satterwhite, D., Taylor, R., and B.
206+
Berry, "Dynamic Link Exchange Protocol (DLEP)", RFC 8175,
207+
DOI 10.17487/RFC8175, June 2017,
208+
<https://www.rfc-editor.org/info/rfc8175>.
209+
181210
Author's Address
182211

183212
%(author)s
@@ -190,6 +219,10 @@ Author's Address
190219

191220

192221

222+
Appendix A. Comments
223+
224+
[RFC8174] is mentioned here just to give the reference classification
225+
code a chance to mess up.
193226

194227

195228

ietf/submit/tests.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from ietf.utils.models import VersionInfo
3636
from ietf.utils.test_data import make_test_data
3737
from ietf.utils.test_utils import login_testing_unauthorized, unicontent, TestCase
38+
from ietf.utils.draft import Draft
3839

3940

4041
def submission_file(name, rev, group, format, templatename, author=None, email=None, title=None, year=None, ascii=True):
@@ -1660,3 +1661,17 @@ def test_api_submit_failed_idnits(self):
16601661
r, author, name = self.post_submission('00', year="1900")
16611662
expected = "Document date must be within 3 days of submission date"
16621663
self.assertContains(r, expected, status_code=400)
1664+
1665+
class RefsTests(TestCase):
1666+
1667+
def test_draft_refs_identification(self):
1668+
1669+
group = None
1670+
file, __ = submission_file('draft-some-subject', '00', group, 'txt', "test_submission.txt", )
1671+
draft = Draft(file.read().decode('utf-8'), file.name)
1672+
refs = draft.get_refs()
1673+
self.assertEqual(refs['rfc2119'], 'norm')
1674+
self.assertEqual(refs['rfc8174'], 'norm')
1675+
self.assertEqual(refs['rfc8126'], 'info')
1676+
self.assertEqual(refs['rfc8175'], 'info')
1677+

0 commit comments

Comments
 (0)