mirror of
https://codeberg.org/Ewen/rudibridge.git
synced 2024-12-22 03:02:32 +00:00
fix: changed order of required parameters
This commit is contained in:
parent
94547f2031
commit
bac9a576ee
|
@ -40,12 +40,13 @@ def parse_page():
|
|||
if not args.get("url"):
|
||||
raise InvalidParameters("Missing parameter: URL")
|
||||
|
||||
if not args.get("title"):
|
||||
raise InvalidParameters("Missing parameter: title")
|
||||
|
||||
if not args.get("article"):
|
||||
raise InvalidParameters("Missing parameter: article")
|
||||
|
||||
if not args.get("title"):
|
||||
raise InvalidParameters("Missing parameter: title")
|
||||
|
||||
|
||||
# Checking for correctness
|
||||
if not args.get("url").startswith("https"):
|
||||
args["url"] = "https://" + args.get("url")
|
||||
|
|
|
@ -5,8 +5,8 @@ import pytest
|
|||
"url,missing_parameter",
|
||||
[
|
||||
("/feed/", "URL"),
|
||||
("/feed/?url=https://mozilla.org", "title"),
|
||||
("/feed/?url=https://mozilla.org&title=h2", "article"),
|
||||
("/feed/?url=https://mozilla.org", "article"),
|
||||
("/feed/?url=https://mozilla.org&article=article", "title"),
|
||||
("/feed/?url=https://mozilla.org&title=h2&article=article", None),
|
||||
],
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue