mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: skip backslash path test on non-Windows (\\ is valid filename char on Linux)
This commit is contained in:
parent
e4452ba253
commit
b52046d209
1 changed files with 6 additions and 0 deletions
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from paperforge.adapters.zotero_paths import (
|
||||
absolutize_vault_path,
|
||||
obsidian_wikilink_for_path,
|
||||
|
|
@ -79,6 +81,10 @@ class TestAbsolutizeVaultPath:
|
|||
assert result == expected
|
||||
|
||||
def test_relative_with_backslashes(self, tmp_path: Path) -> None:
|
||||
"""Backslash path separators are normalised. Only applies on Windows."""
|
||||
import sys
|
||||
if sys.platform != "win32":
|
||||
pytest.skip("Backslash-as-separator is Windows-only behaviour")
|
||||
vault = tmp_path / "vault"
|
||||
vault.mkdir()
|
||||
result = absolutize_vault_path(vault, "subdir\\file.pdf")
|
||||
|
|
|
|||
Loading…
Reference in a new issue