Skip to content

Commit

Permalink
test: resize window before starting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Nov 7, 2023
1 parent 009f9d7 commit 1774bf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions tests/gui/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from Qgis2threejs.tools import js_bool, logMessage


WIDTH, HEIGHT = (800, 600) # view size
UNDEF = "undefined"


Expand Down Expand Up @@ -304,19 +305,11 @@ def runTest(wnd):

initOutputDir()

geomFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), "wnd_geom.bin")
if os.path.exists(geomFile):
with open(geomFile, "rb") as f:
wnd.restoreGeometry(f.read())

logMessage("Window geometry restored from file.")

else:
with open(geomFile, "wb") as f:
f.write(wnd.saveGeometry())

logMessage("Window geometry saved to a file.")
# set view size
wnd.resize(wnd.width() + WIDTH - wnd.ui.webView.width(),
wnd.height() + HEIGHT - wnd.ui.webView.height())

# test suite
testClasses = [SceneTest, PointLayerTest, LineLayerTest, PolygonLayerTest, WidgetTest]
suite = unittest.TestSuite()

Expand Down
Binary file removed tests/gui/wnd_geom.bin
Binary file not shown.

0 comments on commit 1774bf8

Please sign in to comment.