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
40c5fa7a
Unverified
Commit
40c5fa7a
authored
Jan 17, 2022
by
Matheus Felipe
Browse files
Test error message return and return type
parent
d831102a
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/tests/test_validate_format.py
View file @
40c5fa7a
# -*- coding: utf-8 -*-
from
email
import
message
import
unittest
from
validate.format
import
error_message
class
TestValidadeFormat
(
unittest
.
TestCase
):
...
def
test_error_message_return_and_return_type
(
self
):
line_num_unity
=
1
line_num_ten
=
10
line_num_hundred
=
100
line_num_thousand
=
1000
msg
=
'This is a unit test'
err_msg_unity
=
error_message
(
line_num_unity
,
msg
)
err_msg_ten
=
error_message
(
line_num_ten
,
msg
)
err_msg_hundred
=
error_message
(
line_num_hundred
,
msg
)
err_msg_thousand
=
error_message
(
line_num_thousand
,
msg
)
self
.
assertIsInstance
(
err_msg_unity
,
str
)
self
.
assertIsInstance
(
err_msg_ten
,
str
)
self
.
assertIsInstance
(
err_msg_hundred
,
str
)
self
.
assertIsInstance
(
err_msg_thousand
,
str
)
self
.
assertEqual
(
err_msg_unity
,
'(L002) This is a unit test'
)
self
.
assertEqual
(
err_msg_ten
,
'(L011) This is a unit test'
)
self
.
assertEqual
(
err_msg_hundred
,
'(L101) This is a unit test'
)
self
.
assertEqual
(
err_msg_thousand
,
'(L1001) This is a unit test'
)
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