diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-29 17:12:15 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-10-29 17:16:41 +0000 |
commit | 426526c692fecd520b1946f362e148d043c61441 (patch) | |
tree | ff1069aeea1f03a4cfe8233a6aa2def6c05bc9d2 /morphlib/localrepocache_tests.py | |
parent | 4f959335730d37be8d7cd53a2af668d8887e72cc (diff) | |
download | morph-426526c692fecd520b1946f362e148d043c61441.tar.gz |
Echo stderr of subcommands that do network IO when --verbose is used
Morph can appear to hang in situations where it is actually waiting on a
slow network operation. This change gives users a way to see the output
of the subcommands that are doing the network IO (either 'wget', 'git
clone' or 'git remote update').
The status information goes onto stderr, because that is where the
subcommands write it. Morph tends to put its status output on stdout,
but (a) some commands are machine-parsed, such as `serialise-artifact`
and (b) it's tricky to get Git to put status output on stdout.
Diffstat (limited to 'morphlib/localrepocache_tests.py')
-rw-r--r-- | morphlib/localrepocache_tests.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/morphlib/localrepocache_tests.py b/morphlib/localrepocache_tests.py index 22b5ea54..3cc4f07f 100644 --- a/morphlib/localrepocache_tests.py +++ b/morphlib/localrepocache_tests.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2013 Codethink Limited +# Copyright (C) 2012-2014 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,11 @@ import morphlib class FakeApplication(object): + def __init__(self): + self.settings = { + 'verbose': True + } + def status(self, msg): pass @@ -53,7 +58,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc._mkdtemp = self.fake_mkdtemp self._mkdtemp_count = 0 - def fake_git(self, args, cwd=None): + def fake_git(self, args, **kwargs): if args[0] == 'clone': self.assertEqual(len(args), 5) remote = args[3] @@ -112,7 +117,7 @@ class LocalRepoCacheTests(unittest.TestCase): self.lrc.cache_repo(self.repourl) def test_fails_to_cache_when_remote_does_not_exist(self): - def fail(args): + def fail(args, **kwargs): self.lrc.fs.makedir(args[4]) raise cliapp.AppException('') self.lrc._git = fail |