コード例 #1
0
    def test_get_disks(self):
        '''
            Test to return the disks of a named vm
        '''
        with patch.object(xapi, "_get_xapi_session", MagicMock()):
            mock = MagicMock(side_effect=[False, ["a", "b", "c"]])
            with patch.object(xapi, "_get_label_uuid", mock):
                self.assertFalse(xapi.get_disks("salt"))

                self.assertDictEqual(xapi.get_disks("salt"), {})
コード例 #2
0
ファイル: xapi_test.py プロジェクト: dmyerscough/salt
    def test_get_disks(self):
        '''
            Test to return the disks of a named vm
        '''
        with patch.object(xapi, "_get_xapi_session", MagicMock()):
            mock = MagicMock(side_effect=[False, ["a", "b", "c"]])
            with patch.object(xapi, "_get_label_uuid", mock):
                self.assertFalse(xapi.get_disks("salt"))

                self.assertDictEqual(xapi.get_disks("salt"), {})