File: kill-broken-test.patch

package info (click to toggle)
python-pykmip 0.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,840 kB
  • sloc: python: 56,756; sh: 32; makefile: 25
file content (56 lines) | stat: -rw-r--r-- 2,150 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Description: Kill broken test
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2018-02-16

--- python-pykmip-0.7.0.orig/kmip/tests/unit/services/server/test_server.py
+++ python-pykmip-0.7.0/kmip/tests/unit/services/server/test_server.py
@@ -55,48 +55,6 @@ class TestKmipServer(testtools.TestCase)
         self.assertEqual(1, s._session_id)
         self.assertFalse(s._is_serving)
 
-    @mock.patch('logging.getLogger', side_effect=mock.MagicMock())
-    @mock.patch('logging.handlers.RotatingFileHandler')
-    @mock.patch('kmip.services.server.server.KmipServer._setup_configuration')
-    @mock.patch('os.path.exists')
-    @mock.patch('os.path.isdir')
-    @mock.patch('os.makedirs')
-    def test_setup_logging(
-            self,
-            makedirs_mock,
-            isdir_mock,
-            path_mock,
-            config_mock,
-            handler_mock,
-            logging_mock):
-        """
-        Verify that the server logger is setup correctly.
-        """
-        path_mock.return_value = False
-        isdir_mock.return_value = False
-        open_mock = mock.mock_open()
-
-        # Dynamically mock out the built-in open function. Approach changes
-        # across Python versions.
-        try:
-            # For Python3+
-            import builtins  # NOQA
-            module = 'builtins'
-        except ImportError:
-            # For Python2+
-            module = '__builtin__'
-
-        with mock.patch('{0}.open'.format(module), open_mock):
-            s = server.KmipServer(log_path='/test/path/server.log')
-
-        path_mock.assert_called_once_with('/test/path/server.log')
-        isdir_mock.assert_called_once_with('/test/path')
-        makedirs_mock.assert_called_once_with('/test/path')
-        open_mock.assert_called_once_with('/test/path/server.log', 'w')
-
-        self.assertTrue(s._logger.addHandler.called)
-        s._logger.setLevel.assert_any_call(logging.DEBUG)
-
     @mock.patch('kmip.services.server.engine.KmipEngine')
     @mock.patch('kmip.services.auth.TLS12AuthenticationSuite')
     @mock.patch('kmip.services.server.server.KmipServer._setup_logging')