Add -f, --follow flag as option on logs.

Closes #2187
Signed-off-by: Stéphane Seguin <stephseguin93@gmail.com>
This commit is contained in:
Stéphane Seguin 2016-01-21 13:16:04 +01:00
commit 82632098a3
8 changed files with 64 additions and 17 deletions

View file

@ -398,6 +398,8 @@ class CLITestCase(DockerClientTestCase):
assert 'simple_1 | simple' in result.stdout
assert 'another_1 | another' in result.stdout
assert 'simple_1 exited with code 0' in result.stdout
assert 'another_1 exited with code 0' in result.stdout
@v2_only()
def test_up(self):
@ -1141,6 +1143,26 @@ class CLITestCase(DockerClientTestCase):
def test_logs_invalid_service_name(self):
self.dispatch(['logs', 'madeupname'], returncode=1)
def test_logs_follow(self):
self.base_dir = 'tests/fixtures/echo-services'
self.dispatch(['up', '-d'], None)
result = self.dispatch(['logs', '-f'])
assert result.stdout.count('\n') == 5
assert 'simple' in result.stdout
assert 'another' in result.stdout
assert 'exited with code 0' in result.stdout
def test_logs_unfollow(self):
self.base_dir = 'tests/fixtures/logs-composefile'
self.dispatch(['up', '-d'], None)
result = self.dispatch(['logs'])
assert result.stdout.count('\n') >= 1
assert 'exited with code 0' not in result.stdout
def test_kill(self):
self.dispatch(['up', '-d'], None)
service = self.project.get_service('simple')