Testing for modules existance in globals.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
d566c285fd
commit
c3daa92280
2 changed files with 14 additions and 4 deletions
|
@ -16,14 +16,13 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
from re import Pattern
|
||||
from PySide6.QtCore import QMetaObject, QObject
|
||||
from PySide6.QtCore import QMetaObject, QObject, QDateTime
|
||||
from PySide6.QtQml import QJSValue
|
||||
|
||||
class InvalidAttributeValueException(Exception): pass
|
||||
class NotAPrimitiveException(Exception): pass
|
||||
|
||||
class Function: pass
|
||||
class Date: pass
|
||||
class URL: pass
|
||||
|
||||
class PyJSValue:
|
||||
|
@ -80,7 +79,7 @@ class PyJSValue:
|
|||
(lambda: self.qjs_value.isArray(), list),
|
||||
(lambda: self.qjs_value.isBool(), bool),
|
||||
(lambda: self.qjs_value.isCallable(), Function),
|
||||
(lambda: self.qjs_value.isDate(), Date),
|
||||
(lambda: self.qjs_value.isDate(), QDateTime),
|
||||
(lambda: self.qjs_value.isError(), Exception),
|
||||
(lambda: self.qjs_value.isNull(), None),
|
||||
(lambda: self.qjs_value.isNumber(), float),
|
||||
|
|
|
@ -95,4 +95,15 @@ class TestMain:
|
|||
engine, js_globals = create_engine(helper, latex, 0)
|
||||
assert len(engine.rootObjects()) > 0 # QML File loaded.
|
||||
assert type(engine.rootContext().contextProperty("TestBuild")) is bool
|
||||
assert engine.rootContext().contextProperty("StartTime") == 0
|
||||
assert engine.rootContext().contextProperty("StartTime") == 0
|
||||
assert js_globals.Latex.type() is not None
|
||||
assert js_globals.Helper.type() is not None
|
||||
assert js_globals.Modules.type() is not None
|
||||
# Check if modules have loaded
|
||||
assert js_globals.Modules.History.type() is not None
|
||||
assert js_globals.Modules.Latex.type() is not None
|
||||
assert js_globals.Modules.ObjectsCommon.type() is not None
|
||||
assert js_globals.Modules.Canvas.type() is not None
|
||||
assert js_globals.Modules.IO.type() is not None
|
||||
assert js_globals.Modules.Objects.type() is not None
|
||||
assert js_globals.Modules.Preferences.type() is not None
|
Loading…
Reference in a new issue