Full source paths.
This commit is contained in:
@@ -161,7 +161,7 @@ def _summary_from_program(name: str, comp: ProgramSpec, root: Path) -> Component
|
|||||||
# Infer runner from source directory
|
# Infer runner from source directory
|
||||||
runner = None
|
runner = None
|
||||||
if source:
|
if source:
|
||||||
source_dir = root / source
|
source_dir = Path(source)
|
||||||
if (source_dir / "pyproject.toml").exists():
|
if (source_dir / "pyproject.toml").exists():
|
||||||
runner = "python"
|
runner = "python"
|
||||||
elif source_dir.is_file():
|
elif source_dir.is_file():
|
||||||
@@ -316,7 +316,7 @@ def _program_from_spec(
|
|||||||
source = comp.source
|
source = comp.source
|
||||||
runner = None
|
runner = None
|
||||||
if source:
|
if source:
|
||||||
source_dir = root / source
|
source_dir = Path(source)
|
||||||
if (source_dir / "pyproject.toml").exists():
|
if (source_dir / "pyproject.toml").exists():
|
||||||
runner = "python"
|
runner = "python"
|
||||||
elif source_dir.is_file():
|
elif source_dir.is_file():
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ def _tool_summary(
|
|||||||
# Infer runner from source directory
|
# Infer runner from source directory
|
||||||
runner = None
|
runner = None
|
||||||
source = comp.source
|
source = comp.source
|
||||||
if source and root:
|
if source:
|
||||||
source_dir = root / source
|
source_dir = Path(source)
|
||||||
if (source_dir / "pyproject.toml").exists():
|
if (source_dir / "pyproject.toml").exists():
|
||||||
runner = "python"
|
runner = "python"
|
||||||
elif source_dir.is_file():
|
elif source_dir.is_file():
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class TestToolsList:
|
|||||||
data = response.json()
|
data = response.json()
|
||||||
tool = next(t for t in data if t["id"] == "test-tool")
|
tool = next(t for t in data if t["id"] == "test-tool")
|
||||||
assert tool["description"] == "Test tool"
|
assert tool["description"] == "Test tool"
|
||||||
assert tool["source"] == "test-tool"
|
assert tool["source"].endswith("/test-tool")
|
||||||
assert tool["system_dependencies"] == ["pandoc"]
|
assert tool["system_dependencies"] == ["pandoc"]
|
||||||
|
|
||||||
def test_installed_flag(self, client: TestClient) -> None:
|
def test_installed_flag(self, client: TestClient) -> None:
|
||||||
@@ -57,7 +57,7 @@ class TestToolDetail:
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
data = response.json()
|
data = response.json()
|
||||||
assert data["id"] == "test-tool"
|
assert data["id"] == "test-tool"
|
||||||
assert data["source"] == "test-tool"
|
assert data["source"].endswith("/test-tool")
|
||||||
assert data["system_dependencies"] == ["pandoc"]
|
assert data["system_dependencies"] == ["pandoc"]
|
||||||
|
|
||||||
def test_no_docs(self, client: TestClient) -> None:
|
def test_no_docs(self, client: TestClient) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user