Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
1866c0d8
Unverified
Commit
1866c0d8
authored
Jan 13, 2022
by
Matheus Felipe
Browse files
Create basic test to fake_user_agent
parent
b62683f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/tests/test_validate_links.py
View file @
1866c0d8
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
unittest
import
unittest
from
validate.links
import
find_links_in_text
from
validate.links
import
find_links_in_text
from
validate.links
import
fake_user_agent
from
validate.links
import
get_host_from_link
from
validate.links
import
get_host_from_link
from
validate.links
import
has_cloudflare_protection
from
validate.links
import
has_cloudflare_protection
...
@@ -63,6 +64,10 @@ class TestValidateLinks(unittest.TestCase):
...
@@ -63,6 +64,10 @@ class TestValidateLinks(unittest.TestCase):
find_links_in_text
(
1
)
find_links_in_text
(
1
)
find_links_in_text
(
True
)
find_links_in_text
(
True
)
def
test_if_fake_user_agent_has_a_str_as_return
(
self
):
user_agent
=
fake_user_agent
()
self
.
assertIsInstance
(
user_agent
,
str
)
def
test_get_host_from_link
(
self
):
def
test_get_host_from_link
(
self
):
links
=
[
links
=
[
'example.com'
,
'example.com'
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment