mirror of https://github.com/docker/docker-py.git
Fix several integration tests on Windows
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
40711cb501
commit
b4efdc1b28
|
@ -491,6 +491,9 @@ class CreateContainerTest(BaseAPIIntegrationTest):
|
|||
assert rule in self.client.logs(ctnr).decode('utf-8')
|
||||
|
||||
|
||||
@pytest.mark.xfail(
|
||||
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
|
||||
)
|
||||
class VolumeBindTest(BaseAPIIntegrationTest):
|
||||
def setUp(self):
|
||||
super(VolumeBindTest, self).setUp()
|
||||
|
@ -507,9 +510,6 @@ class VolumeBindTest(BaseAPIIntegrationTest):
|
|||
['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(
|
||||
|
@ -525,9 +525,6 @@ class VolumeBindTest(BaseAPIIntegrationTest):
|
|||
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,
|
||||
|
@ -548,9 +545,6 @@ class VolumeBindTest(BaseAPIIntegrationTest):
|
|||
inspect_data = self.client.inspect_container(container)
|
||||
self.check_container_data(inspect_data, False)
|
||||
|
||||
@pytest.mark.xfail(
|
||||
IS_WINDOWS_PLATFORM, reason='Test not designed for Windows platform'
|
||||
)
|
||||
@requires_api_version('1.30')
|
||||
def test_create_with_mounts(self):
|
||||
mount = docker.types.Mount(
|
||||
|
@ -569,9 +563,6 @@ class VolumeBindTest(BaseAPIIntegrationTest):
|
|||
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'
|
||||
)
|
||||
@requires_api_version('1.30')
|
||||
def test_create_with_mounts_ro(self):
|
||||
mount = docker.types.Mount(
|
||||
|
@ -1116,9 +1107,7 @@ class ContainerTopTest(BaseAPIIntegrationTest):
|
|||
|
||||
self.client.start(container)
|
||||
res = self.client.top(container)
|
||||
if IS_WINDOWS_PLATFORM:
|
||||
assert res['Titles'] == ['PID', 'USER', 'TIME', 'COMMAND']
|
||||
else:
|
||||
if not IS_WINDOWS_PLATFORM:
|
||||
assert res['Titles'] == [
|
||||
'UID', 'PID', 'PPID', 'C', 'STIME', 'TTY', 'TIME', 'CMD'
|
||||
]
|
||||
|
|
|
@ -36,6 +36,9 @@ class ContainerCollectionTest(BaseIntegrationTest):
|
|||
with pytest.raises(docker.errors.ImageNotFound):
|
||||
client.containers.run("dockerpytest_does_not_exist")
|
||||
|
||||
@pytest.mark.skipif(
|
||||
docker.constants.IS_WINDOWS_PLATFORM, reason="host mounts on Windows"
|
||||
)
|
||||
def test_run_with_volume(self):
|
||||
client = docker.from_env(version=TEST_API_VERSION)
|
||||
path = tempfile.mkdtemp()
|
||||
|
|
Loading…
Reference in New Issue