What should the "rule" be? I see three cases;
FreeCADcmd, no gui,I think the test should fail as it did.
FreeCAD -c, console mode, but the gui stuff has been built, I think the test should pass here, I think this is how Travis is set up, less the "packaging" issue.
FreeCAD, full gui, maybe with something like this https://forum.freecadweb.org/viewtopic.php?f=4&t=42264 we could test the gui as well.