Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Documentation = "https://jmcomic.readthedocs.io"

[project.scripts]
jmcomic = "jmcomic.cl:main"
jmv = "jmcomic.cl:view_main"

[tool.setuptools.dynamic]
version = {attr = "jmcomic.__version__"}
2 changes: 1 addition & 1 deletion src/jmcomic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 被依赖方 <--- 使用方
# config <--- entity <--- toolkit <--- client <--- option <--- downloader

__version__ = '2.6.17'
__version__ = '2.6.18'

from .api import *
from .jm_plugin import *
Expand Down
25 changes: 25 additions & 0 deletions tests/test_jmcomic/test_jm_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@ def test_jmcomic_download_album(self):

# ========== jmv 命令测试 ==========

def test_entry_points_installed(self):
"""验证控制台命令行是否被正确安装到了所在系统的环境变量里"""
import shutil
import subprocess
for cmd in ['jmcomic', 'jmv']:
self.assertIsNotNone(
shutil.which(cmd),
f"Command '{cmd}' not found in PATH. Please verify entry_points in setup.py or [project.scripts] in pyproject.toml and ensure the package is installed."
)

try:
subprocess.run(
[cmd, "--help"],
capture_output=True,
text=True,
check=True,
timeout=10,
)
except subprocess.TimeoutExpired:
self.fail(f"Command '{cmd} --help' timed out execution.")
except subprocess.CalledProcessError as e:
self.fail(f"Command '{cmd} --help' failed with exit code {e.returncode}. Stderr: {e.stderr.strip()}")
except OSError as e:
self.fail(f"Failed to execute command '{cmd}': {e}")

# -- extract_album_id --

def test_jmv_extract_pure_digits(self):
Expand Down
Loading