From bd17a5cef42fb119569da94d072fe1a80bd54549 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 10 May 2022 14:00:12 +0200 Subject: [PATCH] Part: [skip ci] unit tests for PR #6850 --- src/Mod/Part/TestPartGui.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Mod/Part/TestPartGui.py b/src/Mod/Part/TestPartGui.py index 95c03cb8e8..7f6b09a906 100644 --- a/src/Mod/Part/TestPartGui.py +++ b/src/Mod/Part/TestPartGui.py @@ -41,3 +41,21 @@ import FreeCAD, FreeCADGui, os, sys, unittest, Part, PartGui # def tearDown(self): # #closing doc # FreeCAD.closeDocument("PartGuiTest") +class PartGuiViewProviderTestCases(unittest.TestCase): + def setUp(self): + self.Doc = FreeCAD.newDocument("PartGuiTest") + + def testCanDropObject(self): + # https://github.com/FreeCAD/FreeCAD/pull/6850 + box = self.Doc.addObject("Part::Box", "Box") + with self.assertRaises(TypeError): + box.ViewObject.canDragObject(None) + with self.assertRaises(TypeError): + box.ViewObject.canDropObject(None) + box.ViewObject.canDropObject() + with self.assertRaises(TypeError): + box.ViewObject.dropObject(box, None) + + def tearDown(self): + #closing doc + FreeCAD.closeDocument("PartGuiTest")