Draft: Make startup and tests independent of BIM (#17390)

This commit is contained in:
Chris Mayo
2024-11-16 16:43:46 +00:00
committed by GitHub
parent f638c38dfd
commit 7183de92a4
3 changed files with 15 additions and 3 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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