summaryrefslogtreecommitdiff
path: root/distutils2/tests/test_command_upload.py
diff options
context:
space:
mode:
author?ric Araujo <merwok@netwok.org>2011-09-24 01:06:28 +0200
committer?ric Araujo <merwok@netwok.org>2011-09-24 01:06:28 +0200
commitd04e4c8c1027310520576e1890061799a0f64f0b (patch)
tree50a302c46be60dc998f981feaac252f04a0b43e9 /distutils2/tests/test_command_upload.py
parentd126c30223b0fabb5f96fe5d2a4eefd701284780 (diff)
downloaddisutils2-d04e4c8c1027310520576e1890061799a0f64f0b.tar.gz
Start a branch to provide Distutils2 for Python 3.
This codebase is compatible with 3.1, 3.2 and 3.3. It was converted with 2to3 and a semi-automated diff/merge with packaging in 3.3 to fix some idioms. We?ve now come full circle from 2.x to 3.x to 2.x to 3.x again :) Starting from now, contributors can make patches for packaging (preferred, as the stdlib?s regrtest is very useful), distutils2 or distutils-python3, and we?ll make patches flow between versions.
Diffstat (limited to 'distutils2/tests/test_command_upload.py')
-rw-r--r--distutils2/tests/test_command_upload.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/distutils2/tests/test_command_upload.py b/distutils2/tests/test_command_upload.py
index 76281ca..5c58879 100644
--- a/distutils2/tests/test_command_upload.py
+++ b/distutils2/tests/test_command_upload.py
@@ -1,4 +1,3 @@
-# encoding: utf-8
"""Tests for distutils2.command.upload."""
import os
@@ -44,6 +43,7 @@ repository:http://another.pypi/
"""
+@unittest.skipIf(threading is None, 'needs threading')
class UploadTestCase(support.TempdirManager, support.EnvironRestorer,
support.LoggingCatcher, PyPIServerTestCase):
@@ -112,8 +112,8 @@ class UploadTestCase(support.TempdirManager, support.EnvironRestorer,
# what did we send?
handler, request_data = self.pypi.requests[-1]
headers = handler.headers
- self.assertIn('dédé', request_data)
- self.assertIn('xxx', request_data)
+ self.assertIn('dédé'.encode('utf-8'), request_data)
+ self.assertIn(b'xxx', request_data)
self.assertEqual(int(headers['content-length']), len(request_data))
self.assertLess(int(headers['content-length']), 2500)
@@ -148,12 +148,8 @@ class UploadTestCase(support.TempdirManager, support.EnvironRestorer,
"----------------GHSKFJDLGDS7543FJKLFHRE75642756743254"
.encode())[1:4]
- self.assertIn('name=":action"', action)
- self.assertIn('doc_upload', action)
-
-
-UploadTestCase = unittest.skipIf(threading is None, 'needs threading')(
- UploadTestCase)
+ self.assertIn(b'name=":action"', action)
+ self.assertIn(b'doc_upload', action)
def test_suite():