GitHub

Original file line numberDiff line numberDiff line change

@@ -563,6 +563,11 @@ def handle_NEWNEWS(self, group, date_str, time_str):

563563

<a4929a40-6328-491a-aaaf-cb79ed7309a2@q2g2000vbk.googlegroups.com>

564564

<f30c0419-f549-4218-848f-d7d0131da931@y3g2000vbm.googlegroups.com>

565565

.""")

566+

elif (group == 'comp.lang.python' and

567+

date_str in ('20100101', '100101') and

568+

time_str == '090000'):

569+

self.push_lit('too long line' * 3000 +

570+

'\n.')

566571

else:

567572

self.push_lit("""\

568573

230 An empty list of newsarticles follows

@@ -1158,6 +1163,11 @@ def test_ihave(self):

11581163

self.assertEqual(cm.exception.response,

11591164

"435 Article not wanted")

11601165
1166+

def test_too_long_lines(self):

1167+

dt = datetime.datetime(2010, 1, 1, 9, 0, 0)

1168+

self.assertRaises(nntplib.NNTPDataError,

1169+

self.server.newnews, "comp.lang.python", dt)

1170+
11611171
11621172

class NNTPv1Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase):

11631173

"""Tests an NNTP v1 server (no capabilities)."""

Read the original on github.com ↗