Beispiel #1
0
 def test_load_app_error(self, name):
     parser = inspect_app.make_parser()
     args = Namespace(app_module='{}:{}'.format(_MODULE, name),
                      route_only=False,
                      verbose=False)
     with pytest.raises(SystemExit):
         inspect_app.load_app(parser, args)
Beispiel #2
0
 def test_load_app(self, name):
     parser = inspect_app.make_parser()
     args = Namespace(app_module='{}:{}'.format(
         _MODULE, name), route_only=False, verbose=False)
     app = inspect_app.load_app(parser, args)
     assert isinstance(app, App)
     assert app._router.find('/test') is not None
Beispiel #3
0
 def test_make_parser_error(self):
     parser = inspect_app.make_parser()
     with pytest.raises(SystemExit):
         parser.parse_args([])
Beispiel #4
0
 def test_make_parser(self, args, exp):
     parser = inspect_app.make_parser()
     actual = parser.parse_args(args)
     assert actual == exp
Beispiel #5
0
 def test_load_app_module_error(self):
     parser = inspect_app.make_parser()
     args = Namespace(app_module='foo', route_only=False, verbose=False)
     with pytest.raises(SystemExit):
         inspect_app.load_app(parser, args)