summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2016-10-13 16:45:01 -0700
committerJoffrey F <joffrey@docker.com>2016-10-14 17:14:07 -0700
commitcf4aa9c89ec950ed1d4dbb12b23d6584e29719f0 (patch)
tree3e17b8b99ead66724df7b0c3ae1c2088ca5899ad
parent89758511f8730894f88c612cb025b4ffa3c9fd27 (diff)
downloaddocker-py-cf4aa9c89ec950ed1d4dbb12b23d6584e29719f0.tar.gz
Fix dockerignore exclusion logic on Windows
Signed-off-by: Joffrey F <joffrey@docker.com>
-rw-r--r--docker/utils/utils.py4
-rw-r--r--tests/integration/container_test.py6
2 files changed, 8 insertions, 2 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py
index 72706df..8d55b57 100644
--- a/docker/utils/utils.py
+++ b/docker/utils/utils.py
@@ -194,8 +194,8 @@ def match_path(path, pattern):
if pattern:
pattern = os.path.relpath(pattern)
- pattern_components = pattern.split('/')
- path_components = path.split('/')[:len(pattern_components)]
+ pattern_components = pattern.split(os.path.sep)
+ path_components = path.split(os.path.sep)[:len(pattern_components)]
return fnmatch('/'.join(path_components), pattern)
diff --git a/tests/integration/container_test.py b/tests/integration/container_test.py
index ae2a701..e390acb 100644
--- a/tests/integration/container_test.py
+++ b/tests/integration/container_test.py
@@ -415,6 +415,9 @@ class VolumeBindTest(helpers.BaseTestCase):
['touch', os.path.join(self.mount_dest, self.filename)],
)
+ @pytest.mark.xfail(
+ IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
+ )
def test_create_with_binds_rw(self):
container = self.run_with_volume(
@@ -430,6 +433,9 @@ class VolumeBindTest(helpers.BaseTestCase):
inspect_data = self.client.inspect_container(container)
self.check_container_data(inspect_data, True)
+ @pytest.mark.xfail(
+ IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
+ )
def test_create_with_binds_ro(self):
self.run_with_volume(
False,