aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_glob.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-09-14 15:03:29 -0700
committerJon Dufresne <jon.dufresne@gmail.com>2018-09-14 15:03:46 -0700
commit9a2cb89a1c733343c7040073a799d0cd782e435e (patch)
treee877d77638226681197da24a7af60aca3bc2ea9e /setuptools/tests/test_glob.py
parent948b3f41f9079a1c3afd3a409389d90346ec3bff (diff)
downloadexternal_python_setuptools-9a2cb89a1c733343c7040073a799d0cd782e435e.tar.gz
external_python_setuptools-9a2cb89a1c733343c7040073a799d0cd782e435e.tar.bz2
external_python_setuptools-9a2cb89a1c733343c7040073a799d0cd782e435e.zip
Add tests for setuptools.glob
Diffstat (limited to 'setuptools/tests/test_glob.py')
-rw-r--r--setuptools/tests/test_glob.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/setuptools/tests/test_glob.py b/setuptools/tests/test_glob.py
new file mode 100644
index 00000000..a0728c5d
--- /dev/null
+++ b/setuptools/tests/test_glob.py
@@ -0,0 +1,35 @@
+import pytest
+
+from setuptools.glob import glob
+
+from .files import build_files
+
+
+@pytest.mark.parametrize('tree, pattern, matches', (
+ ('', b'', []),
+ ('', '', []),
+ ('''
+ appveyor.yml
+ CHANGES.rst
+ LICENSE
+ MANIFEST.in
+ pyproject.toml
+ README.rst
+ setup.cfg
+ setup.py
+ ''', '*.rst', ('CHANGES.rst', 'README.rst')),
+ ('''
+ appveyor.yml
+ CHANGES.rst
+ LICENSE
+ MANIFEST.in
+ pyproject.toml
+ README.rst
+ setup.cfg
+ setup.py
+ ''', b'*.rst', (b'CHANGES.rst', b'README.rst')),
+))
+def test_glob(monkeypatch, tmpdir, tree, pattern, matches):
+ monkeypatch.chdir(tmpdir)
+ build_files({name: '' for name in tree.split()})
+ assert list(sorted(glob(pattern))) == list(sorted(matches))