summaryrefslogtreecommitdiff
path: root/app-admin/salt/files/salt-3006-tests.patch
blob: 6135ca8c0ea1c3381ef30b9048873c1b4d223b7e (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
diff --git a/tests/pytests/unit/modules/test_linux_sysctl.py b/tests/pytests/unit/modules/test_linux_sysctl.py
index 0bdd24039d..22df70c58d 100644
--- a/tests/pytests/unit/modules/test_linux_sysctl.py
+++ b/tests/pytests/unit/modules/test_linux_sysctl.py
@@ -215,7 +215,7 @@ def test_persist_no_conf_failure():
         ):
             with pytest.raises(CommandExecutionError):
                 linux_sysctl.persist("net.ipv4.ip_forward", 42, config=None)
-    fopen_mock.called_once()
+    fopen_mock.assert_called_once()
 
 
 def test_persist_no_conf_success():
diff --git a/tests/pytests/unit/modules/test_win_ip.py b/tests/pytests/unit/modules/test_win_ip.py
index 38eb6b1ac5..94a3fe7ca9 100644
--- a/tests/pytests/unit/modules/test_win_ip.py
+++ b/tests/pytests/unit/modules/test_win_ip.py
@@ -151,7 +151,7 @@ def test_enable():
     ):
         assert win_ip.enable("Ethernet")
 
-    mock_cmd.called_once_with(
+    mock_cmd.assert_called_once_with(
         [
             "netsh",
             "interface",
@@ -180,7 +180,7 @@ def test_disable():
     ):
         assert win_ip.disable("Ethernet")
 
-    mock_cmd.called_once_with(
+    mock_cmd.assert_called_once_with(
         [
             "netsh",
             "interface",
diff --git a/tests/pytests/unit/test_master.py b/tests/pytests/unit/test_master.py
index cd11d217c7..502767d3e3 100644
--- a/tests/pytests/unit/test_master.py
+++ b/tests/pytests/unit/test_master.py
@@ -60,7 +60,7 @@ def test_fileserver_duration():
         end = time.time()
         # Interval is equal to timeout so the _do_update method will be called
         # one time.
-        update.called_once()
+        update.assert_called_once()
         # Timeout is 1 second
         duration = end - start
         if duration > 2 and salt.utils.platform.spawning_platform():
diff --git a/tests/pytests/unit/utils/event/test_event.py b/tests/pytests/unit/utils/event/test_event.py
index e289e72dad..2abd4066c4 100644
--- a/tests/pytests/unit/utils/event/test_event.py
+++ b/tests/pytests/unit/utils/event/test_event.py
@@ -300,7 +300,7 @@ def test_connect_pull_should_debug_log_on_StreamClosedError():
     event = SaltEvent(node=None)
     with patch.object(event, "pusher") as mock_pusher:
         with patch.object(
-            salt.utils.event.log, "debug", auto_spec=True
+            salt.utils.event.log, "debug", auto_spec=True, unsafe=True
         ) as mock_log_debug:
             mock_pusher.connect.side_effect = (
                 salt.ext.tornado.iostream.StreamClosedError
@@ -317,10 +317,10 @@ def test_connect_pull_should_error_log_on_other_errors(error):
     event = SaltEvent(node=None)
     with patch.object(event, "pusher") as mock_pusher:
         with patch.object(
-            salt.utils.event.log, "debug", auto_spec=True
+            salt.utils.event.log, "debug", auto_spec=True, unsafe=True
         ) as mock_log_debug:
             with patch.object(
-                salt.utils.event.log, "error", auto_spec=True
+                salt.utils.event.log, "error", auto_spec=True, unsafe=True
             ) as mock_log_error:
                 mock_pusher.connect.side_effect = error
                 event.connect_pull()