mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Add integration test for service name verification
Add a test to make sure NoSuchService is raised if a bogus service name is given to 'docker-compose logs'. Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
This commit is contained in:
parent
2527ef8055
commit
c59c9dd951
@ -7,6 +7,7 @@ from mock import patch
|
||||
|
||||
from .testcases import DockerClientTestCase
|
||||
from compose.cli.main import TopLevelCommand
|
||||
from compose.project import NoSuchService
|
||||
|
||||
|
||||
class CLITestCase(DockerClientTestCase):
|
||||
@ -349,6 +350,10 @@ class CLITestCase(DockerClientTestCase):
|
||||
self.assertEqual(len(service.containers(stopped=True)), 1)
|
||||
self.assertFalse(service.containers(stopped=True)[0].is_running)
|
||||
|
||||
def test_logs_invalid_service_name(self):
|
||||
with self.assertRaises(NoSuchService):
|
||||
self.command.dispatch(['logs', 'madeupname'], None)
|
||||
|
||||
def test_kill(self):
|
||||
self.command.dispatch(['up', '-d'], None)
|
||||
service = self.project.get_service('simple')
|
||||
|
Loading…
x
Reference in New Issue
Block a user