aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_upload_docs.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-05-31 22:35:19 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-05-31 22:35:19 -0400
commitf0a0f6f4ac7bbe405d29c9312956ce973b3e4be0 (patch)
tree9f79177df6ba3f349a13bf966667b7d3b19192aa /setuptools/tests/test_upload_docs.py
parent1f1601d16b93b12451363b46b4b0725300f9b21b (diff)
downloadexternal_python_setuptools-f0a0f6f4ac7bbe405d29c9312956ce973b3e4be0.tar.gz
external_python_setuptools-f0a0f6f4ac7bbe405d29c9312956ce973b3e4be0.tar.bz2
external_python_setuptools-f0a0f6f4ac7bbe405d29c9312956ce973b3e4be0.zip
Add test for build_multipart
Diffstat (limited to 'setuptools/tests/test_upload_docs.py')
-rw-r--r--setuptools/tests/test_upload_docs.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/setuptools/tests/test_upload_docs.py b/setuptools/tests/test_upload_docs.py
index cc71cadb..d3dee616 100644
--- a/setuptools/tests/test_upload_docs.py
+++ b/setuptools/tests/test_upload_docs.py
@@ -57,3 +57,15 @@ class TestUploadDocsTest:
with contextlib.closing(zipfile.ZipFile(tmp_file)) as zip_file:
assert zip_file.namelist() == ['index.html']
+
+ def test_build_multipart(self):
+ data = dict(
+ a="foo",
+ b="bar",
+ file=('file.txt', b'content'),
+ )
+ body, content_type = upload_docs._build_multipart(data)
+ assert 'form-data' in content_type
+ assert isinstance(body, bytes)
+ assert b'foo' in body
+ assert b'content' in body