diff options
author | Joffrey F <joffrey@docker.com> | 2017-01-06 16:37:15 -0800 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2017-01-06 16:37:15 -0800 |
commit | 9450442c8c3e69d6ec82dc9610fe7f8ee31181f2 (patch) | |
tree | 6496b11a84af1e0a0ee2da7f1870555ef12f12bd /tests/unit/utils_test.py | |
parent | 6d871990d207027bc73ab16eae539af280151016 (diff) | |
download | docker-py-compose-4302-dockerignore-windows.tar.gz |
Accept / as a path separator in dockerignore patterns on all platformscompose-4302-dockerignore-windows
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'tests/unit/utils_test.py')
-rw-r--r-- | tests/unit/utils_test.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/utils_test.py b/tests/unit/utils_test.py index 743d076..cf00616 100644 --- a/tests/unit/utils_test.py +++ b/tests/unit/utils_test.py @@ -780,6 +780,16 @@ class ExcludePathsTest(unittest.TestCase): ]) ) + @pytest.mark.skipif( + not IS_WINDOWS_PLATFORM, reason='Backslash patterns only on Windows' + ) + def test_directory_with_subdir_exception_win32_pathsep(self): + assert self.exclude(['foo', '!foo\\bar']) == convert_paths( + self.all_paths - set([ + 'foo/a.py', 'foo/b.py', 'foo', 'foo/Dockerfile3' + ]) + ) + def test_directory_with_wildcard_exception(self): assert self.exclude(['foo', '!foo/*.py']) == convert_paths( self.all_paths - set([ @@ -792,6 +802,14 @@ class ExcludePathsTest(unittest.TestCase): self.all_paths - set(['foo/bar', 'foo/bar/a.py']) ) + @pytest.mark.skipif( + not IS_WINDOWS_PLATFORM, reason='Backslash patterns only on Windows' + ) + def test_subdirectory_win32_pathsep(self): + assert self.exclude(['foo\\bar']) == convert_paths( + self.all_paths - set(['foo/bar', 'foo/bar/a.py']) + ) + class TarTest(unittest.TestCase): def test_tar_with_excludes(self): |