|
|
|
|
@ -46,6 +46,11 @@ def _install_fake_freecad():
|
|
|
|
|
sys.modules["FreeCADGui"] = fake_freecadgui
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _install_fake_freecad_without_gui_commands():
|
|
|
|
|
_install_fake_freecad()
|
|
|
|
|
sys.modules["FreeCADGui"] = types.ModuleType("FreeCADGui")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class FakeViewObject:
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.Visibility = True
|
|
|
|
|
@ -115,6 +120,13 @@ def _reload_modules():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TemplateAuthoringTest(unittest.TestCase):
|
|
|
|
|
def test_import_skips_command_registration_when_gui_has_no_add_command(self):
|
|
|
|
|
_install_fake_freecad_without_gui_commands()
|
|
|
|
|
|
|
|
|
|
template_authoring = _reload_modules()
|
|
|
|
|
|
|
|
|
|
self.assertTrue(hasattr(template_authoring, "save_template_as_fcstd"))
|
|
|
|
|
|
|
|
|
|
def test_create_template_terminal_writes_lcs_semantics(self):
|
|
|
|
|
_install_fake_freecad()
|
|
|
|
|
template_authoring = _reload_modules()
|
|
|
|
|
|