def test_create_and_list_snapshots(self): mock_service = self.mock_cinder.return_value scenario = volumes.CreateAndListSnapshots(self._get_context()) scenario.run(False, True, fakearg="f") mock_service.create_snapshot.assert_called_once_with("uuid", force=False, fakearg="f") mock_service.list_snapshots.assert_called_once_with(True)
def test_create_and_list_snapshots(self): fake_snapshot = mock.MagicMock() scenario = volumes.CreateAndListSnapshots(self._get_context()) scenario._create_snapshot = mock.MagicMock(return_value=fake_snapshot) scenario._list_snapshots = mock.MagicMock() scenario.run(False, True, fakearg="f") scenario._create_snapshot.assert_called_once_with("uuid", force=False, fakearg="f") scenario._list_snapshots.assert_called_once_with(True)