Skip to content
Myr

Merge branch '2.1.x'

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parents c99f07d, ab6a8b0 · Browse files · 1 file+16 added−17 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−17 removed

  • tests:+16 added−17 removed

1 file+16 added−17 removed

modified:tests/test_cli.py+16 added-17 removed
451 unmodified lines
452453454class TestRoutes:455 @pytest.fixture456 def invoke(self, runner):457 def create_app():458 app = Flask(__name__)459 app.testing = True456 def app(self):457 app = Flask(__name__)458 app.testing = True459461 @app.route("/get_post/<int:x>/<int:y>", methods=["GET", "POST"])462 def yyy_get_post(x, y):463 pass460 @app.route("/get_post/<int:x>/<int:y>", methods=["GET", "POST"])461 def yyy_get_post(x, y):462 pass463465 @app.route("/zzz_post", methods=["POST"])466 def aaa_post():467 pass464 @app.route("/zzz_post", methods=["POST"])465 def aaa_post():466 pass467469 return app468 return app469470 @pytest.fixture471 def invoke(self, app, runner):471 cli = FlaskGroup(create_app=create_app)472 cli = FlaskGroup(create_app=lambda: app)473 return partial(runner.invoke, cli)474475 @pytest.fixture476 def invoke_no_routes(self, runner):
16 unmodified lines
493 result = invoke(["routes"])494 assert result.exit_code == 0495 self.expect_order(["aaa_post", "static", "yyy_get_post"], result.output)496496 def test_sort(self, invoke):497 def test_sort(self, app, invoke):498 default_output = invoke(["routes"]).output499 endpoint_output = invoke(["routes", "-s", "endpoint"]).output500 assert default_output == endpoint_output501 self.expect_order(
3 unmodified lines
505 self.expect_order(506 ["yyy_get_post", "static", "aaa_post"],507 invoke(["routes", "-s", "rule"]).output,508 )508 self.expect_order(509 ["aaa_post", "yyy_get_post", "static"],510 invoke(["routes", "-s", "match"]).output,511 )509 match_order = [r.endpoint for r in app.url_map.iter_rules()]510 self.expect_order(match_order, invoke(["routes", "-s", "match"]).output)511512 def test_all_methods(self, invoke):513 output = invoke(["routes"]).output514 assert "GET, HEAD, OPTIONS, POST" not in output
186 unmodified lines