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
mentors.debian.net
debexpo
Commits
1714996c
Verified
Commit
1714996c
authored
Jan 07, 2022
by
Baptiste Beauplat
Browse files
Add unit test to cover MaintainerEmail plugin failing on invalid email
parent
d9ebbcae
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/unit/importer/test_plugins.py
View file @
1714996c
...
...
@@ -27,9 +27,11 @@
# OTHER DEALINGS IN THE SOFTWARE.
from
tests
import
TestController
from
types
import
SimpleNamespace
from
debexpo.plugins.models
import
PluginManager
,
BasePlugin
,
PluginSeverity
,
\
PluginResults
PluginResults
,
ExceptionPlugin
from
debexpo.plugins.maintaineremail
import
PluginMaintainerEmail
class
PluginBad
(
BasePlugin
):
...
...
@@ -103,3 +105,15 @@ class TestPluginResults(TestController):
result
=
PluginResults
()
self
.
assertEquals
(
result
.
data
,
{})
class
TestPluginMaintainerEmail
(
TestController
):
def
test_maintainer_email_emtpy
(
self
):
changes
=
SimpleNamespace
()
changes
.
maintainer
=
''
plugin
=
PluginMaintainerEmail
()
with
self
.
assertRaises
(
ExceptionPlugin
)
as
e
:
plugin
.
run
(
changes
,
None
)
self
.
assertIn
(
'No maintainer address found'
,
str
(
e
.
exception
))
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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