ソースを参照

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 <[email protected]>
Dan O'Reilly 10 年 前
コミット
c59c9dd951
1 ファイル変更5 行追加0 行削除
  1. 5 0
      tests/integration/cli_test.py

+ 5 - 0
tests/integration/cli_test.py

@@ -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')