55
66
77sampleSize = 1470 # 44100 / 30 = 1470
8+ testFile = "inputfiles/test.jpg"
89
910
1011@fixture
@@ -19,15 +20,15 @@ def coreWithImageComp(qtbot, command):
1920def test_comp_image_set_path (coreWithImageComp ):
2021 "Set imagePath of Image component"
2122 comp = coreWithImageComp .selectedComponents [0 ]
22- comp .imagePath = getTestDataPath ("inputfiles/test.jpg" )
23+ comp .imagePath = getTestDataPath (testFile )
2324 image = comp .previewRender ()
2425 assert imageDataSum (image ) == 463711601
2526
2627
2728def test_comp_image_scale_50_1080p (coreWithImageComp ):
2829 """Image component stretches image to 50% at 1080p"""
2930 comp = coreWithImageComp .selectedComponents [0 ]
30- comp .imagePath = getTestDataPath ("inputfiles/test.jpg" )
31+ comp .imagePath = getTestDataPath (testFile )
3132 image = comp .previewRender ()
3233 sum = imageDataSum (image )
3334 comp .page .spinBox_scale .setValue (50 )
@@ -37,7 +38,7 @@ def test_comp_image_scale_50_1080p(coreWithImageComp):
3738def test_comp_image_scale_50_720p (coreWithImageComp ):
3839 """Image component stretches image to 50% at 720p"""
3940 comp = coreWithImageComp .selectedComponents [0 ]
40- comp .imagePath = getTestDataPath ("inputfiles/test.jpg" )
41+ comp .imagePath = getTestDataPath (testFile )
4142 comp .page .spinBox_scale .setValue (50 )
4243 image = comp .previewRender ()
4344 sum = imageDataSum (image )
@@ -47,3 +48,12 @@ def test_comp_image_scale_50_720p(coreWithImageComp):
4748 assert image .width == 1920
4849 assert newImage .width == 1280
4950 assert imageDataSum (comp .previewRender ()) == sum
51+
52+
53+ def test_comp_image_command_path (coreWithImageComp ):
54+ """Image component accepts commandline argument:
55+ `path=test.jpg`"""
56+ imgPath = os .path .realpath (getTestDataPath (testFile ))
57+ comp = coreWithImageComp .selectedComponents [0 ]
58+ comp .command (f"path={ imgPath } " )
59+ assert comp .imagePath == imgPath
0 commit comments