(self)
| 169 | self.norm('aab', 'F')]) |
| 170 | |
| 171 | def test_glob_directory_with_trailing_slash(self): |
| 172 | seps = (os.sep, os.altsep) if os.altsep else (os.sep,) |
| 173 | for sep in seps: |
| 174 | # Patterns ending with a slash shouldn't match non-dirs |
| 175 | self.assertEqual(glob.glob(self.norm('Z*Z') + sep), []) |
| 176 | self.assertEqual(glob.glob(self.norm('ZZZ') + sep), []) |
| 177 | self.assertEqual(glob.glob(self.norm('aaa') + sep), |
| 178 | [self.norm('aaa') + sep]) |
| 179 | # Preserving the redundant separators is an implementation detail. |
| 180 | self.assertEqual(glob.glob(self.norm('aaa') + sep*2), |
| 181 | [self.norm('aaa') + sep*2]) |
| 182 | # When there is a wildcard pattern which ends with a pathname |
| 183 | # separator, glob() doesn't blow. |
| 184 | # The result should end with the pathname separator. |
| 185 | # Normalizing the trailing separator is an implementation detail. |
| 186 | eq = self.assertSequencesEqual_noorder |
| 187 | eq(glob.glob(self.norm('aa*') + sep), |
| 188 | [self.norm('aaa') + os.sep, self.norm('aab') + os.sep]) |
| 189 | # Stripping the redundant separators is an implementation detail. |
| 190 | eq(glob.glob(self.norm('aa*') + sep*2), |
| 191 | [self.norm('aaa') + os.sep, self.norm('aab') + os.sep]) |
| 192 | |
| 193 | def test_glob_bytes_directory_with_trailing_slash(self): |
| 194 | # Same as test_glob_directory_with_trailing_slash, but with a |
nothing calls this directly
no test coverage detected