Add an acceptance test and docs for the down subcommand
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
c8ed156806
commit
c64af0a459
13 changed files with 102 additions and 13 deletions
26
tests/unit/volume_test.py
Normal file
26
tests/unit/volume_test.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import docker
|
||||
import pytest
|
||||
|
||||
from compose import volume
|
||||
from tests import mock
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_client():
|
||||
return mock.create_autospec(docker.Client)
|
||||
|
||||
|
||||
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_name='data')
|
||||
vol.remove()
|
||||
assert not mock_client.remove_volume.called
|
||||
Loading…
Add table
Add a link
Reference in a new issue