aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-07-02 12:26:44 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-07-02 12:26:44 -0400
commite85ad92f72239d12ede4e5755f84ffef01877032 (patch)
tree37e6e0a0a73d4ba7adf7b3a2a70342d6deb95310 /setuptools/tests
parent54325a753f688285c71a6db0a062116e6dc6976c (diff)
parent94d97d07df600cca0d51703b13297b73f5b1d9d0 (diff)
downloadexternal_python_setuptools-e85ad92f72239d12ede4e5755f84ffef01877032.tar.gz
external_python_setuptools-e85ad92f72239d12ede4e5755f84ffef01877032.tar.bz2
external_python_setuptools-e85ad92f72239d12ede4e5755f84ffef01877032.zip
Merge with 23.2.1
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_build_py.py31
-rw-r--r--setuptools/tests/test_upload_docs.py12
2 files changed, 43 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_py.py b/setuptools/tests/test_build_py.py
new file mode 100644
index 00000000..ed1703ac
--- /dev/null
+++ b/setuptools/tests/test_build_py.py
@@ -0,0 +1,31 @@
+import os
+
+import pytest
+
+from setuptools.dist import Distribution
+
+
+@pytest.yield_fixture
+def tmpdir_as_cwd(tmpdir):
+ with tmpdir.as_cwd():
+ yield tmpdir
+
+
+def test_directories_in_package_data_glob(tmpdir_as_cwd):
+ """
+ Directories matching the glob in package_data should
+ not be included in the package data.
+
+ Regression test for #261.
+ """
+ dist = Distribution(dict(
+ script_name='setup.py',
+ script_args=['build_py'],
+ packages=[''],
+ name='foo',
+ package_data={'': ['path/*']},
+ ))
+ os.makedirs('path/subpath')
+ #with contexts.quiet():
+ dist.parse_command_line()
+ dist.run_commands()
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