/usr/lib/python3/dist-packages/pathspec/tests/test_pathspec.py is in python3-pathspec 0.3.4-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | # encoding: utf-8
"""
This script tests ``PathSpec``.
"""
import unittest
import pathspec
class PathSpecTest(unittest.TestCase):
"""
The ``PathSpecTest`` class tests the ``PathSpec`` class.
"""
def test_01_windows_paths(self):
"""
Tests that Windows paths will be properly normalized and matched.
"""
spec = pathspec.PathSpec.from_lines('gitignore', [
'*.txt',
'!test1/',
])
results = set(spec.match_files([
'src\\test1\\a.txt',
'src\\test1\\b.txt',
'src\\test1\\c\\c.txt',
'src\\test2\\a.txt',
'src\\test2\\b.txt',
'src\\test2\\c\\c.txt',
], separators=('\\',)))
self.assertEqual(results, {
'src\\test2\\a.txt',
'src\\test2\\b.txt',
'src\\test2\\c\\c.txt',
})
|