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
monkeysphere
monkeysign
Commits
eaa41668
Commit
eaa41668
authored
Jan 28, 2017
by
anarcat
Browse files
Merge branch 'feature/quieter-test-output' into '2.x'
Quiet logging in test output when not in debug mode See merge request
!22
parents
9f78da7e
78c56043
Changes
2
Hide whitespace changes
Inline
Side-by-side
monkeysign/tests/test_ui.py
View file @
eaa41668
...
...
@@ -73,6 +73,15 @@ class CliBaseTest(unittest.TestCase):
self
.
argv
=
sys
.
argv
sys
.
argv
=
[
'monkeysign'
,
'--no-mail'
]
if
'--debug'
not
in
self
.
argv
:
# Save the logging handlers on the root logger to a variable
# and replace them with a NullHandler (the null handler
# prevents logging calls from trying to add a stream handler
# back). This stops output from the tested functions from
# printing to the console and cluttering things up.
self
.
logging_handlers
=
logging
.
getLogger
().
handlers
logging
.
getLogger
().
handlers
=
[
logging
.
NullHandler
()]
def
execute
(
self
):
'''execute the monkeysign script directly
...
...
@@ -120,6 +129,10 @@ class CliBaseTest(unittest.TestCase):
def
tearDown
(
self
):
sys
.
argv
=
self
.
argv
if
'--debug'
not
in
self
.
argv
:
# Restore the logging handlers we removed in the setup function
logging
.
getLogger
().
handlers
=
self
.
logging_handlers
@
unittest
.
skipUnless
(
Mock
,
'mock library missing'
)
class
CliTestCase
(
CliBaseTest
):
...
...
monkeysign/ui.py
View file @
eaa41668
...
...
@@ -475,7 +475,7 @@ configuration files are parsed by default: %s"""
# cargo-culted from caff, thanks guilhem!
src
=
self
.
keyring
.
get_agent_socket
()
dst
=
self
.
tmpkeyring
.
get_agent_socket
()
logger
.
info
(
_
(
'installing symlinks for sockets from %s to %s'
),
(
src
,
dst
)
)
logger
.
info
(
_
(
'installing symlinks for sockets from %s to %s'
),
src
,
dst
)
try
:
os
.
unlink
(
dst
)
except
OSError
as
e
:
...
...
@@ -775,7 +775,7 @@ expects an EmailFactory email, but will not mail if nomail is set"""
logger
.
warning
(
_
(
"""
\
not sending email to %s, as requested, here's the encrypted signed public key you can paste in your email client:
%s"""
),
(
msg
.
mailto
,
msg
.
encrypted
())
)
%s"""
),
msg
.
mailto
,
msg
.
encrypted
())
class
EmailFactory
:
...
...
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