Files
compose/tests/unit/volume_test.py
Bastian Venthur e8424d5ae0 Removed Python2 support
Closes: #6890

Signed-off-by: Bastian Venthur <bastian.venthur@flixbus.com>
2020-06-03 17:37:47 +02:00

24 lines
605 B
Python

import docker
import pytest
from compose import volume
from tests import mock
@pytest.fixture
def mock_client():
return mock.create_autospec(docker.APIClient)
class TestVolume(object):
def test_remove_local_volume(self, mock_client):
vol = volume.Volume(mock_client, 'foo', 'project')
vol.remove()
mock_client.remove_volume.assert_called_once_with('foo_project')
def test_remove_external_volume(self, mock_client):
vol = volume.Volume(mock_client, 'foo', 'project', external=True)
vol.remove()
assert not mock_client.remove_volume.called