diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-09-08 22:06:02 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-09-08 22:06:02 +0000 |
| commit | 1a2bb4843237102f75a44ee70bb8d6680986c6e3 (patch) | |
| tree | d7755c94167468a5bdcc731cc82d4b9c562324d0 /openstackclient/tests/common | |
| parent | b4421e380244ca1c94fca27de9027829b158b6e0 (diff) | |
| parent | 9c3c33639139ab319ca6d00925b34f9293ca81af (diff) | |
| download | python-openstackclient-1a2bb4843237102f75a44ee70bb8d6680986c6e3.tar.gz | |
Merge "Move set warnings filters to logging module"
Diffstat (limited to 'openstackclient/tests/common')
| -rw-r--r-- | openstackclient/tests/common/test_context.py | 9 |
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): |
