Revision 152759e4 test/py/ganeti.backend_unittest.py
b/test/py/ganeti.backend_unittest.py | ||
---|---|---|
655 | 655 |
_SOME_RESULT = None |
656 | 656 |
|
657 | 657 |
def testApplyStorageInfoFunction(self): |
658 |
excl_storage_flag = False |
|
659 | 658 |
backend._ApplyStorageInfoFunction = mock.Mock( |
660 | 659 |
return_value=self._SOME_RESULT) |
661 |
storage_units = [(st, st + "_key") for st in |
|
660 |
storage_units = [(st, st + "_key", [st + "_params"]) for st in
|
|
662 | 661 |
constants.VALID_STORAGE_TYPES] |
663 | 662 |
|
664 |
backend.GetNodeInfo(storage_units, None, excl_storage_flag)
|
|
663 |
backend.GetNodeInfo(storage_units, None) |
|
665 | 664 |
|
666 | 665 |
call_args_list = backend._ApplyStorageInfoFunction.call_args_list |
667 | 666 |
self.assertEqual(len(constants.VALID_STORAGE_TYPES), len(call_args_list)) |
668 | 667 |
for call in call_args_list: |
669 |
storage_type, storage_key, excl_storage = call[0]
|
|
668 |
storage_type, storage_key, storage_params = call[0]
|
|
670 | 669 |
self.assertEqual(storage_type + "_key", storage_key) |
670 |
self.assertEqual([storage_type + "_params"], storage_params) |
|
671 | 671 |
self.assertTrue(storage_type in constants.VALID_STORAGE_TYPES) |
672 | 672 |
|
673 | 673 |
|
Also available in: Unified diff