aboutsummaryrefslogtreecommitdiff
path: root/tests/test_text_comp.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_text_comp.py')
-rw-r--r--tests/test_text_comp.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test_text_comp.py b/tests/test_text_comp.py
new file mode 100644
index 0000000..3bc0be6
--- /dev/null
+++ b/tests/test_text_comp.py
@@ -0,0 +1,32 @@
+from avp.command import Command
+from pytestqt import qtbot
+from pytest import fixture
+from . import audioData, MockSignal, imageDataSum
+
+
+@fixture
+def coreWithTextComp(qtbot):
+ """Fixture providing a Command object with Title Text component added"""
+ command = Command()
+ command.core.insertComponent(0, command.core.moduleIndexFor("Title Text"), command)
+ yield command.core
+
+
+def test_comp_text_renderFrame_resize(coreWithTextComp):
+ """Call renderFrame of Title Text component added to Command object."""
+ comp = coreWithTextComp.selectedComponents[0]
+ comp.parent.settings.setValue("outputWidth", 1920)
+ comp.parent.settings.setValue("outputHeight", 1080)
+ comp.parent.core.updateComponent(0)
+ image = comp.frameRender(0)
+ assert imageDataSum(image) == 2957069
+
+
+def test_comp_text_renderFrame(coreWithTextComp):
+ """Call renderFrame of Title Text component added to Command object."""
+ comp = coreWithTextComp.selectedComponents[0]
+ comp.parent.settings.setValue("outputWidth", 1280)
+ comp.parent.settings.setValue("outputHeight", 720)
+ comp.parent.core.updateComponent(0)
+ image = comp.frameRender(0)
+ assert imageDataSum(image) == 1412293 or 1379298