Draft: Make startup and tests independent of BIM (#17390)
This commit is contained in:
@@ -37,6 +37,13 @@ import drafttests.auxiliary as aux
|
||||
|
||||
from draftutils.messages import _msg
|
||||
|
||||
try:
|
||||
import Arch
|
||||
except ModuleNotFoundError:
|
||||
have_arch = False
|
||||
else:
|
||||
have_arch = True
|
||||
|
||||
|
||||
class DraftSVG(unittest.TestCase):
|
||||
"""Test reading and writing of SVGs with Draft."""
|
||||
@@ -87,10 +94,10 @@ class DraftSVG(unittest.TestCase):
|
||||
obj = Draft.export_svg(out_file)
|
||||
self.assertTrue(obj, "'{}' failed".format(operation))
|
||||
|
||||
@unittest.skipIf(not have_arch, "BIM module is not installed")
|
||||
def test_get_svg_from_arch_space_with_zero_vector(self):
|
||||
"""Try to get a svg string from an Arch Space with a zero-vector as direction."""
|
||||
import Part
|
||||
import Arch
|
||||
import Draft
|
||||
|
||||
sb = Part.makeBox(1,1,1)
|
||||
|
||||
@@ -28,7 +28,10 @@ import xml.etree.ElementTree as ET
|
||||
|
||||
import FreeCAD as App
|
||||
import Draft_rc
|
||||
import Arch_rc
|
||||
try:
|
||||
import Arch_rc
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
||||
from draftutils import init_draft_statusbar
|
||||
from draftutils.translate import translate
|
||||
|
||||
@@ -71,7 +71,9 @@ class ViewProviderWorkingPlaneProxy:
|
||||
vobj.Transparency = 70
|
||||
vobj.LineWidth = 1
|
||||
|
||||
vobj.LineColor = params.get_param_arch("ColorHelpers") & 0xFFFFFF00
|
||||
ch = params.get_param_arch("ColorHelpers")
|
||||
if ch:
|
||||
vobj.LineColor = ch & 0xFFFFFF00
|
||||
|
||||
vobj.Proxy = self
|
||||
vobj.RestoreView = True
|
||||
|
||||
Reference in New Issue
Block a user