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
229b77a4
Unverified
Commit
229b77a4
authored
Jan 17, 2022
by
Matheus Felipe
Browse files
Fix tests of check_title
parent
d04c02a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/tests/test_validate_format.py
View file @
229b77a4
...
...
@@ -114,33 +114,14 @@ class TestValidadeFormat(unittest.TestCase):
with
self
.
subTest
():
self
.
assertEqual
(
err_msg
,
ex_err_msg
)
def
test_check_title_return_type
(
self
):
raw_title_1
=
'[A](https://www.ex.com)'
raw_title_2
=
'[A(https://www.ex.com)'
raw_title_3
=
'[A API](https://www.ex.com)'
result_1
=
check_title
(
0
,
raw_title_1
)
result_2
=
check_title
(
0
,
raw_title_2
)
result_3
=
check_title
(
0
,
raw_title_3
)
self
.
assertIsInstance
(
result_1
,
list
)
self
.
assertIsInstance
(
result_2
,
list
)
self
.
assertIsInstance
(
result_3
,
list
)
err_msg_1
=
result_2
[
0
]
err_msg_2
=
result_3
[
0
]
self
.
assertIsInstance
(
err_msg_1
,
str
)
self
.
assertIsInstance
(
err_msg_2
,
str
)
def
test_check_title_with_correct_title
(
self
):
raw_title
=
'[A](https://www.ex.com)'
err_msgs
=
check_title
(
0
,
raw_title
)
self
.
assertIsInstance
(
err_msgs
,
list
)
self
.
assertEqual
(
len
(
err_msgs
),
0
)
self
.
assertEqual
(
err_msgs
,
[])
def
test_check_title_with_markdown_syntax_incorrect
(
self
):
...
...
@@ -148,6 +129,7 @@ class TestValidadeFormat(unittest.TestCase):
err_msgs
=
check_title
(
0
,
raw_title
)
self
.
assertIsInstance
(
err_msgs
,
list
)
self
.
assertEqual
(
len
(
err_msgs
),
1
)
err_msg
=
err_msgs
[
0
]
...
...
@@ -159,7 +141,8 @@ class TestValidadeFormat(unittest.TestCase):
raw_title
=
'[A API](https://www.ex.com)'
err_msgs
=
check_title
(
0
,
raw_title
)
self
.
assertIsInstance
(
err_msgs
,
list
)
self
.
assertEqual
(
len
(
err_msgs
),
1
)
err_msg
=
err_msgs
[
0
]
...
...
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