Fixes #1434, Project.containers with service_names.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
4f40d0c168
commit
022f81711e
2 changed files with 30 additions and 2 deletions
|
|
@ -6,6 +6,29 @@ from .testcases import DockerClientTestCase
|
|||
|
||||
|
||||
class ProjectTest(DockerClientTestCase):
|
||||
|
||||
def test_containers(self):
|
||||
web = self.create_service('web')
|
||||
db = self.create_service('db')
|
||||
project = Project('composetest', [web, db], self.client)
|
||||
|
||||
project.up()
|
||||
|
||||
containers = project.containers()
|
||||
self.assertEqual(len(containers), 2)
|
||||
|
||||
def test_containers_with_service_names(self):
|
||||
web = self.create_service('web')
|
||||
db = self.create_service('db')
|
||||
project = Project('composetest', [web, db], self.client)
|
||||
|
||||
project.up()
|
||||
|
||||
containers = project.containers(['web'])
|
||||
self.assertEqual(
|
||||
[c.name for c in containers],
|
||||
['composetest_web_1'])
|
||||
|
||||
def test_volumes_from_service(self):
|
||||
service_dicts = config.from_dictionary({
|
||||
'data': {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue