summaryrefslogtreecommitdiff
path: root/openstackclient/tests
diff options
context:
space:
mode:
authorTerryHowe <terrylhowe@gmail.com>2015-08-09 06:26:56 -0600
committerTerryHowe <terrylhowe@gmail.com>2015-08-13 16:05:01 -0600
commit9c3c33639139ab319ca6d00925b34f9293ca81af (patch)
treef6474101c16988ee9e5a0c3c9e38dcc64f0bc0f8 /openstackclient/tests
parente23dd6de5854fcc8ff76fe1b51eb46162770d9cc (diff)
downloadpython-openstackclient-9c3c33639139ab319ca6d00925b34f9293ca81af.tar.gz
Move set warnings filters to logging module
This is the first step in moving logging out of shell.py Change-Id: I3dcb4e17bb4687988ddf9b793ad1a308ef89b242 Implements: blueprint logging-migration
Diffstat (limited to 'openstackclient/tests')
-rw-r--r--openstackclient/tests/common/test_context.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/openstackclient/tests/common/test_context.py b/openstackclient/tests/common/test_context.py
index 145546a3..8e1bcf83 100644
--- a/openstackclient/tests/common/test_context.py
+++ b/openstackclient/tests/common/test_context.py
@@ -62,6 +62,15 @@ class TestContext(utils.TestCase):
context.setup_logging(shell, cloud_config)
self.assertEqual(True, shell.enable_operation_logging)
+ @mock.patch('warnings.simplefilter')
+ def test_set_warning_filter(self, simplefilter):
+ context.set_warning_filter(logging.ERROR)
+ simplefilter.assert_called_with("ignore")
+ context.set_warning_filter(logging.WARNING)
+ simplefilter.assert_called_with("ignore")
+ context.set_warning_filter(logging.INFO)
+ simplefilter.assert_called_with("once")
+
class Test_LogContext(utils.TestCase):
def setUp(self):