Ajout du GUI

This commit is contained in:
thatscringebro
2022-08-08 16:31:52 -04:00
parent db362ccdca
commit abd15f28b6
851 changed files with 99957 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
from itertools import product
from kivy.tests import GraphicUnitTest
class WindowBaseTest(GraphicUnitTest):
def test_to_normalized_pos(self):
win = self.Window
old_system_size = win.system_size[:]
win.system_size = w, h = type(old_system_size)((320, 240))
try:
for x, y in product([0, 319, 50, 51], [0, 239, 50, 51]):
expected_sx = x / (w - 1.0)
expected_sy = y / (h - 1.0)
result_sx, result_sy = win.to_normalized_pos(x, y)
assert result_sx == expected_sx
assert result_sy == expected_sy
finally:
win.system_size = old_system_size