mirror of
https://github.com/bendtherules/pytest_gui_status.git
synced 2026-08-18 13:42:26 +00:00
Revert window pos set to start + add tmpl_name to all fake_app_gui
This commit is contained in:
@@ -44,11 +44,6 @@ class Controller(htmlPy.Object):
|
|||||||
# self.app_gui.window.minimumWidth, self.app_gui.window.minimumHeight = (0, 0)
|
# self.app_gui.window.minimumWidth, self.app_gui.window.minimumHeight = (0, 0)
|
||||||
self.app_gui.width, self.app_gui.height = self.dict_tmpl_size.get(self.app_gui.tmpl_name)
|
self.app_gui.width, self.app_gui.height = self.dict_tmpl_size.get(self.app_gui.tmpl_name)
|
||||||
|
|
||||||
screen_geo = QApplication.desktop().availableGeometry()
|
|
||||||
screen_topright = screen_geo.topRight()
|
|
||||||
self.app_gui.x_pos = (screen_topright.x() - 20) - self.app_gui.width
|
|
||||||
self.app_gui.y_pos = (screen_topright.y() + 20)
|
|
||||||
|
|
||||||
@htmlPy.Slot()
|
@htmlPy.Slot()
|
||||||
def redraw(self):
|
def redraw(self):
|
||||||
redis_db = redis.StrictRedis(host='localhost', port=REDIS_PORT, db=0)
|
redis_db = redis.StrictRedis(host='localhost', port=REDIS_PORT, db=0)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import htmlPy
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import PyQt4.QtCore as QtCore
|
import PyQt4.QtCore as QtCore
|
||||||
|
from PyQt4.QtGui import QApplication
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
# Import back-end functionalities
|
# Import back-end functionalities
|
||||||
@@ -32,6 +33,11 @@ def main():
|
|||||||
# app.window.setWindowFlags(app.window.windowFlags() & ~QtCore.Qt.WindowMaximizeButtonHint)
|
# app.window.setWindowFlags(app.window.windowFlags() & ~QtCore.Qt.WindowMaximizeButtonHint)
|
||||||
app.window.setWindowFlags(app.window.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
|
app.window.setWindowFlags(app.window.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
|
||||||
|
|
||||||
|
screen_geo = QApplication.desktop().availableGeometry()
|
||||||
|
screen_topright = screen_geo.topRight()
|
||||||
|
app.x_pos = (screen_topright.x() - 20) - app.width
|
||||||
|
app.y_pos = (screen_topright.y() + 20)
|
||||||
|
|
||||||
# GUI configarg
|
# GUI configarg
|
||||||
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||||
app.static_path = os.path.join(BASE_DIR, "static/")
|
app.static_path = os.path.join(BASE_DIR, "static/")
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ class TestRedisFail(object):
|
|||||||
|
|
||||||
# mock Controller requirements and app_gui.stop
|
# mock Controller requirements and app_gui.stop
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
||||||
gui_backend.Controller(fake_app_gui).redraw()
|
gui_backend.Controller(fake_app_gui).redraw()
|
||||||
|
|
||||||
@@ -97,6 +98,7 @@ class TestRedisFail(object):
|
|||||||
|
|
||||||
# mock Controller requirements and app_gui.stop
|
# mock Controller requirements and app_gui.stop
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
||||||
gui_backend.Controller(fake_app_gui).redraw()
|
gui_backend.Controller(fake_app_gui).redraw()
|
||||||
|
|
||||||
@@ -123,6 +125,7 @@ class TestRedisFail(object):
|
|||||||
|
|
||||||
# mock Controller requirements and app_gui.stop
|
# mock Controller requirements and app_gui.stop
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
|
|
||||||
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
||||||
gui_backend.Controller(fake_app_gui).redraw()
|
gui_backend.Controller(fake_app_gui).redraw()
|
||||||
@@ -149,6 +152,7 @@ class TestRedisFail(object):
|
|||||||
# mock Controller requirements and app_gui.stop
|
# mock Controller requirements and app_gui.stop
|
||||||
# provide invalid path
|
# provide invalid path
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
fake_app_gui.dir_name = r"Invalid/Path"
|
fake_app_gui.dir_name = r"Invalid/Path"
|
||||||
|
|
||||||
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
with pytest.raises(redis.exceptions.ConnectionError) as error_info:
|
||||||
@@ -185,6 +189,7 @@ class TestBackendState(object):
|
|||||||
|
|
||||||
# mock app_gui with path
|
# mock app_gui with path
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
fake_app_gui.dir_name = tmpdir.strpath
|
fake_app_gui.dir_name = tmpdir.strpath
|
||||||
|
|
||||||
tmp_controller = gui_backend.Controller(fake_app_gui)
|
tmp_controller = gui_backend.Controller(fake_app_gui)
|
||||||
@@ -224,6 +229,7 @@ class TestBackendState(object):
|
|||||||
|
|
||||||
# mock app_gui with path
|
# mock app_gui with path
|
||||||
fake_app_gui = MagicMock()
|
fake_app_gui = MagicMock()
|
||||||
|
fake_app_gui.tmpl_name = "default"
|
||||||
fake_app_gui.dir_name = tmpdir.strpath
|
fake_app_gui.dir_name = tmpdir.strpath
|
||||||
|
|
||||||
tmp_controller = gui_backend.Controller(fake_app_gui)
|
tmp_controller = gui_backend.Controller(fake_app_gui)
|
||||||
|
|||||||
Reference in New Issue
Block a user