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