def test_verbosity_level(self): set_verbosity_level(1) self.assertEqual(1, get_verbosity_level()) self.assertTrue(is_verbose()) self.assertFalse(is_quiet()) set_verbosity_level(-1) self.assertEqual(-1, get_verbosity_level()) self.assertFalse(is_verbose()) self.assertTrue(is_quiet()) set_verbosity_level(0) self.assertEqual(0, get_verbosity_level()) self.assertFalse(is_verbose()) self.assertFalse(is_quiet())
def adjust_verbosity(cmd): if is_quiet(): cmd += ['-q'] if is_verbose(): cmd += ['-v']