Skip to content

Commit b4efdc1

Browse files
committed
Fix several integration tests on Windows
Signed-off-by: Joffrey F <[email protected]>
1 parent 40711cb commit b4efdc1

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

tests/integration/api_container_test.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,9 @@ def test_create_with_device_cgroup_rules(self):
491491
assert rule in self.client.logs(ctnr).decode('utf-8')
492492

493493

494+
@pytest.mark.xfail(
495+
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
496+
)
494497
class VolumeBindTest(BaseAPIIntegrationTest):
495498
def setUp(self):
496499
super(VolumeBindTest, self).setUp()
@@ -507,9 +510,6 @@ def setUp(self):
507510
['touch', os.path.join(self.mount_dest, self.filename)],
508511
)
509512

510-
@pytest.mark.xfail(
511-
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
512-
)
513513
def test_create_with_binds_rw(self):
514514

515515
container = self.run_with_volume(
@@ -525,9 +525,6 @@ def test_create_with_binds_rw(self):
525525
inspect_data = self.client.inspect_container(container)
526526
self.check_container_data(inspect_data, True)
527527

528-
@pytest.mark.xfail(
529-
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
530-
)
531528
def test_create_with_binds_ro(self):
532529
self.run_with_volume(
533530
False,
@@ -548,9 +545,6 @@ def test_create_with_binds_ro(self):
548545
inspect_data = self.client.inspect_container(container)
549546
self.check_container_data(inspect_data, False)
550547

551-
@pytest.mark.xfail(
552-
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
553-
)
554548
@requires_api_version('1.30')
555549
def test_create_with_mounts(self):
556550
mount = docker.types.Mount(
@@ -569,9 +563,6 @@ def test_create_with_mounts(self):
569563
inspect_data = self.client.inspect_container(container)
570564
self.check_container_data(inspect_data, True)
571565

572-
@pytest.mark.xfail(
573-
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
574-
)
575566
@requires_api_version('1.30')
576567
def test_create_with_mounts_ro(self):
577568
mount = docker.types.Mount(
@@ -1116,9 +1107,7 @@ def test_top(self):
11161107

11171108
self.client.start(container)
11181109
res = self.client.top(container)
1119-
if IS_WINDOWS_PLATFORM:
1120-
assert res['Titles'] == ['PID', 'USER', 'TIME', 'COMMAND']
1121-
else:
1110+
if not IS_WINDOWS_PLATFORM:
11221111
assert res['Titles'] == [
11231112
'UID', 'PID', 'PPID', 'C', 'STIME', 'TTY', 'TIME', 'CMD'
11241113
]

tests/integration/models_containers_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ def test_run_with_image_that_does_not_exist(self):
3636
with pytest.raises(docker.errors.ImageNotFound):
3737
client.containers.run("dockerpytest_does_not_exist")
3838

39+
@pytest.mark.skipif(
40+
docker.constants.IS_WINDOWS_PLATFORM, reason="host mounts on Windows"
41+
)
3942
def test_run_with_volume(self):
4043
client = docker.from_env(version=TEST_API_VERSION)
4144
path = tempfile.mkdtemp()

0 commit comments

Comments
 (0)