Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Jan 9, 2024
1 parent 3758af0 commit aa0492b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
16 changes: 5 additions & 11 deletions application/tests/web_main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
Expand Down Expand Up @@ -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:
Expand All @@ -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)
Expand All @@ -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}'
)
Expand All @@ -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}'
)
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion application/web/web_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,9 @@ def smartlink(
@app.route("/deeplink/<name>/section/<section>/sectionID/<section_id>", methods=["GET"])
@app.route("/deeplink/<name>/sectionid/<section_id>", methods=["GET"])
@app.route("/deeplink/<name>/sectionID/<section_id>", 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")
Expand Down

0 comments on commit aa0492b

Please sign in to comment.