From 9c3c33639139ab319ca6d00925b34f9293ca81af Mon Sep 17 00:00:00 2001 From: TerryHowe Date: Sun, 9 Aug 2015 06:26:56 -0600 Subject: 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 --- openstackclient/tests/common/test_context.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'openstackclient/tests') 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): -- cgit v1.2.1