Skip to content

Commit 43f72a7

Browse files
author
jomae
committed
1.6.1dev: adapt unit tests to multipart 1.0.0+ and remove pin the multipart version on GitHub Actions (closes #13788)
git-svn-id: http://trac.edgewall.org/intertrac/log:/branches/1.6-stable@17854 af82e41b-90c4-0310-8c96-b1721e28e2e2
1 parent 3a28b32 commit 43f72a7

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.github/requirements-minimum.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Jinja2
2-
multipart<1.0.0; python_version>='3.11'
2+
multipart; python_version>='3.11'
33
aiosmtpd; python_version>='3.10'
44
selenium!=4.10.0
55
pytidylib

.github/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Jinja2
2-
multipart<1.0.0; python_version>='3.11'
2+
multipart; python_version>='3.11'
33
aiosmtpd; python_version>='3.10'
44
selenium!=4.10.0
55
pytidylib

trac/web/tests/api.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def test_getfile(self):
284284
file_ = req.args.getfile('attachment')
285285

286286
self.assertEqual(str(file_name, 'utf-8'), file_[0])
287-
self.assertEqual(file_content, file_[1].getvalue())
287+
self.assertEqual(file_content, file_[1].read())
288288
self.assertEqual(len(file_content), file_[2])
289289

290290
def test_getfilelist(self):
@@ -327,9 +327,9 @@ def test_getfilelist(self):
327327

328328
self.assertEqual(2, len(file_))
329329
self.assertEqual(str(file_name[0], 'utf-8'), file_[0][0])
330-
self.assertEqual(file_content[0], file_[0][1].getvalue())
330+
self.assertEqual(file_content[0], file_[0][1].read())
331331
self.assertEqual(str(file_name[1], 'utf-8'), file_[1][0])
332-
self.assertEqual(file_content[1], file_[1][1].getvalue())
332+
self.assertEqual(file_content[1], file_[1][1].read())
333333
self.assertEqual(len(file_content[1]), file_[1][2])
334334

335335
def test_require(self):
@@ -553,13 +553,15 @@ def test_post_with_unnamed_value(self):
553553
environ = _make_environ(method='POST', **{
554554
'wsgi.input': io.BytesIO(form_data),
555555
'CONTENT_LENGTH': str(len(form_data)),
556-
'CONTENT_TYPE': content_type
556+
'CONTENT_TYPE': content_type,
557557
})
558558
req = Request(environ, None)
559559

560560
self.assertEqual('named value', req.args['foo'])
561-
self.assertEqual([('foo', 'named value'), ('', 'name is empty'),
562-
(None, 'unnamed value')], req.arg_list)
561+
self.assertEqual([('foo', 'named value'), ('', 'name is empty')],
562+
req.arg_list[:2])
563+
self.assertIn(req.arg_list[2][0], [None, ''])
564+
self.assertEqual('unnamed value', req.arg_list[2][1])
563565

564566
def _test_post_with_null_bytes(self, form_data):
565567
boundary = '_BOUNDARY_'

0 commit comments

Comments
 (0)