Add a test for existence of kitty-tool

This commit is contained in:
Kovid Goyal 2022-08-16 22:15:50 +05:30
parent c85af36116
commit fb4c7db25e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 10 additions and 1 deletions

View File

@ -79,6 +79,10 @@ def kitty_exe() -> str:
return os.path.join(rpath, 'kitty')
def kitty_tool_exe() -> str:
return os.path.join(os.path.dirname(kitty_exe()), 'kitty-tool')
def _get_config_dir() -> str:
if 'KITTY_CONFIG_DIRECTORY' in os.environ:
return os.path.abspath(os.path.expanduser(os.environ['KITTY_CONFIG_DIRECTORY']))

View File

@ -4,6 +4,7 @@
import os
import stat
import subprocess
import sys
import unittest
from functools import partial
@ -14,11 +15,15 @@ from . import BaseTest
class TestBuild(BaseTest):
def test_exe(self) -> None:
from kitty.constants import kitty_exe
from kitty.constants import kitty_exe, kitty_tool_exe, str_version
exe = kitty_exe()
self.assertTrue(os.access(exe, os.X_OK))
self.assertTrue(os.path.isfile(exe))
self.assertIn('kitty', os.path.basename(exe))
exe = kitty_tool_exe()
self.assertTrue(os.access(exe, os.X_OK))
self.assertTrue(os.path.isfile(exe))
self.assertIn(str_version, subprocess.check_output([exe, '--version']).decode())
def test_loading_extensions(self) -> None:
import kitty.fast_data_types as fdt