diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-05-31 22:35:19 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-05-31 22:35:19 -0400 |
commit | f0a0f6f4ac7bbe405d29c9312956ce973b3e4be0 (patch) | |
tree | 9f79177df6ba3f349a13bf966667b7d3b19192aa /setuptools/tests/test_upload_docs.py | |
parent | 1f1601d16b93b12451363b46b4b0725300f9b21b (diff) | |
download | external_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.py | 12 |
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 |