Beispiel #1
0
    def test_guest_uncouple_nic(self, mock_userid, mock_uncouple):

        body_str = '{"info": {"couple": "false"}}'
        self.req.body = body_str

        mock_userid.side_effect = self.mock_get_userid_vdev

        guest.guest_couple_uncouple_nic(self.req)
        mock_uncouple.assert_called_once_with(FAKE_USERID,
                                              "1000",
                                              active=False)
Beispiel #2
0
    def test_guest_couple_nic(self, mock_userid, mock_couple):
        body_str = '{"info": {"couple": "true", "vswitch": "vsw1"}}'
        self.req.body = body_str
        mock_couple.return_value = ''

        mock_userid.side_effect = self.mock_get_userid_vdev

        guest.guest_couple_uncouple_nic(self.req)
        mock_couple.assert_called_once_with('guest_nic_couple_to_vswitch',
                                            FAKE_USERID,
                                            "1000",
                                            "vsw1",
                                            active=False)