Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
pit-ray committed Jun 13, 2023
1 parent f4f2ab8 commit ca8c459
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
19 changes: 0 additions & 19 deletions tests/runtime/checks/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def get_cases():
increase_window_width,
resize_window_height,
snap_current_window_to_right,
window_resizer
]


Expand Down Expand Up @@ -52,21 +51,3 @@ def snap_current_window_to_right(handler, mock_app):
target_h = sh

return w == target_w and h == target_h


def window_resizer(handler, mock_app):
mock_app.focus()

x1, y1 = mock_app.get_window_pos()
w1, h1 = mock_app.get_window_size()

# [winresizer] a user-defined macro defined in vindrc_gen.py.
# [ll] increate width in resize mode
# [e] change mode to move mode
# [jj] Down the y coordinate of the window
# [<esc>] Exit windowresizer
handler.send_command('winresizerllejj<esc>', pause=2)
x2, y2 = mock_app.get_window_pos()
w2, h2 = mock_app.get_window_size()

return w1 < w2 and h1 == h2 and x1 == x2 and y1 < y2
18 changes: 6 additions & 12 deletions tests/runtime/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import subprocess
from glob import glob
from functools import lru_cache
from shutil import copyfile
from distutils.dir_util import copy_tree
import shutil

from vindrc_gen import VINDRC_GEN

Expand Down Expand Up @@ -37,22 +38,15 @@ def setup_environment(self):
# Copy win-vind binary into the temporary directory.
dest_exe_path = os.path.join(self.env_root, 'win-vind.exe')
if not os.path.isfile(dest_exe_path):
copyfile(self.exe_path, dest_exe_path)
shutil.copyfile(self.exe_path, dest_exe_path)

# Copy the resource files into the temporary directory.
resource_dir = os.path.join(self.env_root, 'resources')
os.makedirs(resource_dir, exist_ok=True)

source_resource_query = os.path.join(
os.path.dirname(self.exe_path), 'resources', '*')
resource_files = glob(source_resource_query)

for filename in resource_files:
dest_path = os.path.join(
resource_dir, os.path.basename(filename))

if not os.path.isfile(dest_path):
copyfile(filename, dest_path)
copy_tree(
os.path.join(os.path.dirname(self.exe_path), 'resources'),
resource_dir)

# Set the install type as portable.
instype_file = os.path.join(resource_dir, '.instype')
Expand Down
1 change: 0 additions & 1 deletion tests/unit/alone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ AddTest(each-mapsolver-test
${CMAKE_CURRENT_SOURCE_DIR}/mapsolver_test.cpp

${SRCDIR}/bind/bindedfunc.cpp
${SRCDIR}/bind/mapdefault.cpp
${SRCDIR}/core/cmdmatcher.cpp
${SRCDIR}/core/cmdparser.cpp
${SRCDIR}/core/cmdunit.cpp
Expand Down

0 comments on commit ca8c459

Please sign in to comment.