mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Fixed #7748: now upload and register commands don't need to force the encoding anymore : DistributionMetada returns utf8 strings
This commit is contained in:
parent
aa98058cc4
commit
f14c7fc33d
6 changed files with 28 additions and 19 deletions
|
@ -1,4 +1,5 @@
|
|||
"""Tests for distutils.command.upload."""
|
||||
# -*- encoding: utf8 -*-
|
||||
import sys
|
||||
import os
|
||||
import unittest
|
||||
|
@ -107,14 +108,15 @@ class uploadTestCase(PyPIRCCommandTestCase):
|
|||
self.write_file(self.rc, PYPIRC_LONG_PASSWORD)
|
||||
|
||||
# lets run it
|
||||
pkg_dir, dist = self.create_dist(dist_files=dist_files)
|
||||
pkg_dir, dist = self.create_dist(dist_files=dist_files, author=u'dédé')
|
||||
cmd = upload(dist)
|
||||
cmd.ensure_finalized()
|
||||
cmd.run()
|
||||
|
||||
# what did we send ?
|
||||
self.assertIn('dédé', self.last_open.req.data)
|
||||
headers = dict(self.last_open.req.headers)
|
||||
self.assertEquals(headers['Content-length'], '2086')
|
||||
self.assertEquals(headers['Content-length'], '2085')
|
||||
self.assertTrue(headers['Content-type'].startswith('multipart/form-data'))
|
||||
self.assertEquals(self.last_open.req.get_method(), 'POST')
|
||||
self.assertEquals(self.last_open.req.get_full_url(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue