Add default labels to networks and volumes created by Compose
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
e6b2949edc
commit
ba47fb99ba
7 changed files with 68 additions and 10 deletions
|
|
@ -4,6 +4,8 @@ from __future__ import unicode_literals
|
|||
from docker.errors import DockerException
|
||||
|
||||
from .testcases import DockerClientTestCase
|
||||
from compose.const import LABEL_PROJECT
|
||||
from compose.const import LABEL_VOLUME
|
||||
from compose.volume import Volume
|
||||
|
||||
|
||||
|
|
@ -94,3 +96,11 @@ class VolumeTest(DockerClientTestCase):
|
|||
assert vol.exists() is False
|
||||
vol.create()
|
||||
assert vol.exists() is True
|
||||
|
||||
def test_volume_default_labels(self):
|
||||
vol = self.create_volume('volume01')
|
||||
vol.create()
|
||||
vol_data = vol.inspect()
|
||||
labels = vol_data['Labels']
|
||||
assert labels[LABEL_VOLUME] == vol.name
|
||||
assert labels[LABEL_PROJECT] == vol.project
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue