diff --git a/application/tests/web_main_test.py b/application/tests/web_main_test.py index 0cdb293d..f3e722cc 100644 --- a/application/tests/web_main_test.py +++ b/application/tests/web_main_test.py @@ -736,7 +736,6 @@ def test_deeplink(self) -> None: ) self.assertEqual(404, response.status_code) - cres = { "ca": defs.CRE(id="1", description="CA", name="CA", tags=["ta"]), "cd": defs.CRE(id="2", description="CD", name="CD", tags=["td"]), @@ -789,7 +788,6 @@ def test_deeplink(self) -> None: self.assertEqual(head[1], standards["ASVS"].hyperlink) self.assertEqual(302, response.status_code) - # Can retrieve with sectionid response = client.get("/deeplink/ASVS?sectionid=v0.1.2") for head in response.headers: @@ -805,9 +803,7 @@ def test_deeplink(self) -> None: self.assertEqual(302, response.status_code) # Can retrieve with section - response = client.get( - f'/deeplink/ASVS?section={standards["ASVS"].section}' - ) + response = client.get(f'/deeplink/ASVS?section={standards["ASVS"].section}') for head in response.headers: if head[0] == "Location": self.assertEqual(head[1], standards["ASVS"].hyperlink) @@ -822,7 +818,7 @@ def test_deeplink(self) -> None: self.assertEqual(head[1], standards["ASVS"].hyperlink) self.assertEqual(302, response.status_code) - # Can retrieve with sectionid in path params + # Can retrieve with sectionid in path params response = client.get( f'/deeplink/ASVS/sectionid/{standards["ASVS"].sectionID}' ) @@ -831,7 +827,7 @@ def test_deeplink(self) -> None: self.assertEqual(head[1], standards["ASVS"].hyperlink) self.assertEqual(302, response.status_code) - # Can retrieve with sectionID in path params + # Can retrieve with sectionID in path params response = client.get( f'/deeplink/ASVS/sectionID/{standards["ASVS"].sectionID}' ) @@ -840,10 +836,8 @@ def test_deeplink(self) -> None: self.assertEqual(head[1], standards["ASVS"].hyperlink) self.assertEqual(302, response.status_code) - # Can retrieve with section in path params - response = client.get( - f'/deeplink/ASVS/section/{standards["ASVS"].section}' - ) + # Can retrieve with section in path params + response = client.get(f'/deeplink/ASVS/section/{standards["ASVS"].section}') for head in response.headers: if head[0] == "Location": self.assertEqual(head[1], standards["ASVS"].hyperlink) diff --git a/application/web/web_main.py b/application/web/web_main.py index c7350567..2e949832 100644 --- a/application/web/web_main.py +++ b/application/web/web_main.py @@ -524,7 +524,9 @@ def smartlink( @app.route("/deeplink//section/
/sectionID/", methods=["GET"]) @app.route("/deeplink//sectionid/", methods=["GET"]) @app.route("/deeplink//sectionID/", methods=["GET"]) -def deeplink(name: str, ntype: str = "",section:str="",section_id:str="") -> Any: +def deeplink( + name: str, ntype: str = "", section: str = "", section_id: str = "" +) -> Any: database = db.Node_collection() opt_section = request.args.get("section") opt_sectionID = request.args.get("sectionID")