예제 #1
0
 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)
예제 #2
0
 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'])
예제 #3
0
 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)
예제 #4
0
 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)