Commit 6c1dc5b
committed
unit_tests: fix winrm listener asserts
mock.Mock().method_name.return_value if not set specifically, it returns
a mock, thus being equivalent to a logical True.
Added a return value in either case, so that it is visible.
Without the return value set in both cases, the unit test fail on Python
3.12.
Also, the try-`finally` is run outside of the `with` context, thus
moving the `assert_has_calls` after `with` checks.
Change-Id: Ic33afb6d1403b1096e06406ffd6d36a969f823d3
Signed-off-by: Adrian Vladu <avladu@cloudbasesolutions.com>1 parent b241de1 commit 6c1dc5b
1 file changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | | - | |
107 | | - | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
0 commit comments