Exemple #1
0
    def call_script(self, *args):
        class Stop(Exception):
            pass
        def error(myself, message):
            self.error = message
            raise Stop

        from jove.scripts.main import main
        self.out.truncate(0)
        argv = ('jove', '-C', self.ini_path) + args
        try:
            with mock.patch('jove.scripts.main.argparse.ArgumentParser.error',
                            error):
                main(argv, self.out)
        except Stop:
            pass
Exemple #2
0
 def test_duplicate_entry_points(self, iter_eps):
     from jove.scripts.main import main
     iter_eps.return_value = [
         DummyEntryPoint('foo'), DummyEntryPoint('foo')]
     with self.assertRaises(RuntimeError):
         main()