tests: improve test failure message

When multiple Admin API calls are expected, but not all were made, show
which were missing.
This commit is contained in:
Marek Marczykowski-Górecki 2017-07-06 21:38:23 +02:00
父節點 b35303ff62
當前提交 a3e3dac6dc
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: 063938BA42CFA724

查看文件

@ -158,8 +158,10 @@ class QubesTestCase(unittest.TestCase):
set(self.app.expected_calls.keys()),
set(self.app.actual_calls))
# and also check if calls expected multiple times were called
self.assertFalse(any(x for x in self.app.expected_calls.values() if
isinstance(x, list)))
self.assertFalse([(call, ret)
for call, ret in self.app.expected_calls.items() if
isinstance(ret, list) and ret],
'Some calls not called expected number of times')
def assertNotRaises(self, excClass, callableObj=None, *args, **kwargs):
"""Fail if an exception of class excClass is raised