def test_main_verbose(self): """Execute the main function with the verbose flag.""" log = Mock(logging) jhalfs.main(args=['-v'], mconfig=self.mconfig, log=log) log.basicConfig.assert_called_with( format='%(asctime)s %(levelname)-6s %(message)s', level=logging.DEBUG)
def test_main_version(self): """Supplying the version argument will simply print a version and exit.""" # noinspection PyTypeChecker with self.assertRaises(SystemExit): jhalfs.main(args=['-V'])
def test_main_reconfigure(self): """Execute the main function with the reconfigure flag.""" os.mkdir(self.statedir) pathlib.Path(self.configfile).touch() mconfig = Mock(menuconfig) jhalfs.main(args=['-r'], mconfig=mconfig)
def test_main_help(self): """Execute the main function with the help flag.""" # noinspection PyTypeChecker with self.assertRaises(SystemExit): jhalfs.main(args=['-h'], mconfig=self.mconfig)