raise error when -q and -t are supplied together

This commit is contained in:
Adrian Sampson 2011-04-19 13:56:45 -07:00
parent a75a524178
commit 3dbce11a25
2 changed files with 10 additions and 0 deletions

View file

@ -416,6 +416,10 @@ def import_files(lib, paths, copy, write, autot, logpath, art, threaded,
if not os.path.isdir(syspath(path)):
raise ui.UserError('not a directory: ' + path)
# Check parameter consistency.
if quiet and timid:
raise ui.UserError("can't be both quiet and timid")
# Open the log.
if logpath:
logfile = open(logpath, 'w')

View file

@ -164,6 +164,12 @@ class AutotagTest(unittest.TestCase):
self.io.addinput('u')
self._no_candidates_test(importer.action.ASIS)
class ImportTest(unittest.TestCase):
def test_quiet_timid_disallowed(self):
self.assertRaises(ui.UserError, commands.import_files,
None, [], False, False, False, None, False, False,
False, False, True, False, None, False, True)
class InputTest(unittest.TestCase):
def setUp(self):
self.io = _common.DummyIO()