B ÔÂ_‡ã@s*dZddlZddlZGdd„dejƒZdS)z! This script tests ``PathSpec``. éNc@sPeZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z dd„Z dd„Z dS)Ú PathSpecTestz< The ``PathSpecTest`` class tests the ``PathSpec`` class. c CsBtj dddg¡}t| dddddd g¡ƒ}| |ddd h¡d S) zc Tests that paths referencing the current directory will be properly normalized and matched. Ú gitwildmatchz*.txtz!test1/z./src/test1/a.txtz./src/test1/b.txtz./src/test1/c/c.txtz./src/test2/a.txtz./src/test2/b.txtz./src/test2/c/c.txtN)ÚpathspecÚPathSpecÚ from_linesÚsetÚ match_filesÚ assertEqual)ÚselfÚspecÚresults©r ú@/tmp/pip-unpacked-wheel-sh474h94/pathspec/tests/test_pathspec.pyÚtest_01_current_dir_pathss z&PathSpecTest.test_01_current_dir_pathscCsPtj dddg¡}dddddd g}tt|j|ƒƒ}t| |¡ƒ}| ||¡d S) zl Tests that matching files one at a time yields the same results as matching multiples files at once. rz*.txtz!test1/zsrc/test1/a.txtzsrc/test1/b.txtzsrc/test1/c/c.txtzsrc/test2/a.txtzsrc/test2/b.txtzsrc/test2/c/c.txtN)rrrrÚfilterZ match_filerr )r r Z test_filesZsingle_resultsZ multi_resultsr r rÚtest_01_match_files'sz PathSpecTest.test_01_match_filescCsFtj dddg¡}t|jdddddd gd d ƒ}| |ddd h¡d S) zc Tests that paths referencing the current directory will be properly normalized and matched. rz*.txtz!test1/z.\src\test1\a.txtz.\src\test1\b.txtz.\src\test1\c\c.txtz.\src\test2\a.txtz.\src\test2\b.txtz.\src\test2\c\c.txt)ú\)Ú separatorsN)rrrrrr )r r r r r rÚ!test_01_windows_current_dir_paths<s z.PathSpecTest.test_01_windows_current_dir_pathscCsFtj dddg¡}t|jdddddd gd d ƒ}| |ddd h¡d S) zG Tests that Windows paths will be properly normalized and matched. rz*.txtz!test1/zsrc\test1\a.txtzsrc\test1\b.txtzsrc\test1\c\c.txtzsrc\test2\a.txtzsrc\test2\b.txtzsrc\test2\c\c.txt)r)rN)rrrrrr )r r r r r rÚtest_01_windows_pathsSs z"PathSpecTest.test_01_windows_pathscCs4tj dddg¡}tj dddg¡}| ||¡dS)z Tests equality. rz*.txtz!test1/N)rrrr )r Ú first_specÚ second_specr r rÚ test_02_eqiszPathSpecTest.test_02_eqcCs0tj ddg¡}tj ddg¡}| ||¡dS)z Tests equality. rz*.txtz!*.txtN)rrrZassertNotEqual)r rrr r rÚ test_02_news zPathSpecTest.test_02_necCs^tj dddg¡}tj dddg¡}||}t|jddddgddƒ}| |ddddh¡dS) z, Test pattern addition using + operator rztest.txtztest.pngz test.htmlztest.jpg)r)rN)rrrrrr )r rrZ combined_specr r r rÚtest_01_additionƒs$ zPathSpecTest.test_01_additioncCsZtj dddg¡}|tj dddg¡7}t|jddddgddƒ}| |ddddh¡dS) z- Test pattern addition using += operator rztest.txtztest.pngz test.htmlztest.jpg)r)rN)rrrrrr )r r r r r rÚtest_02_additions"   zPathSpecTest.test_02_additionN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rrrrrrrrr r r rr s r)rZunittestrZTestCaserr r r rÚs