Skip to content

Commit 0b8e024

Browse files
committed
Update kivy test resolution
1 parent 4ad0839 commit 0b8e024

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/bitmessagekivy/mpybit.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,17 @@ class NavigateApp(MDApp):
8888
identity_list = get_identity_list()
8989
image_path = load_image_path()
9090
app_platform = platform
91-
kivy_state.screen_density = Window.size
92-
window_size = kivy_state.screen_density
9391
tr = Lang("en") # for changing in franch replace en with fr
9492

95-
if os.environ.get('INSTALL_TESTS', False):
96-
# Set kivy app resolution while running kivy tests
97-
window_size = (720, 1280)
98-
9993
def __init__(self):
10094
super(NavigateApp, self).__init__()
10195
# workaround for relative imports
10296
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
10397
self.data_screens, self.all_data, self.data_screen_dict, response = load_screen_json()
10498
self.kivy_state_obj = KivyStateVariables()
10599
self.image_dir = load_image_path()
100+
self.kivy_state_obj.screen_density = Window.size
101+
self.window_size = self.kivy_state_obj.screen_density
106102

107103
def build(self):
108104
"""Method builds the widget"""

src/mock/kivy_main.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1+
# pylint: disable=unused-import, wrong-import-position, ungrouped-imports
2+
# flake8: noqa:E401, E402
3+
14
"""Mock kivy app with mock threads."""
2-
# pylint: disable=unused-import
3-
# flake8: noqa:E401
45

6+
import os
7+
from kivy.config import Config
8+
import multiqueue
59
from pybitmessage import state
6-
from pybitmessage.bitmessagekivy.mpybit import NavigateApp
710

8-
import multiqueue
9-
from class_addressGenerator import FakeAddressGenerator
10-
from pybitmessage.mock.network import stats, objectracker
11+
if os.environ.get('INSTALL_TESTS', False):
12+
Config.set('graphics', 'height', 1280)
13+
Config.set('graphics', 'width', 720)
14+
Config.set('graphics', 'position', 'custom')
15+
Config.set('graphics', 'top', 0)
16+
Config.set('graphics', 'left', 0)
17+
18+
19+
from pybitmessage.mock.class_addressGenerator import FakeAddressGenerator # noqa:E402
20+
from pybitmessage.bitmessagekivy.mpybit import NavigateApp # noqa:E402
21+
from pybitmessage.mock.network import stats, objectracker # noqa:E402
1122

1223

1324
def main():

0 commit comments

Comments
 (0)