mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 20:22:03 +03:00
fix: use PurePosixPath in os_timezone symlink test so it doesn't break on Windows
This commit is contained in:
parent
dda9426544
commit
94fbfdcb17
1 changed files with 2 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path, PurePosixPath
|
||||||
from unittest.mock import MagicMock, patch
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
from netsleuth.cli import _dedupe, _os_timezone, parse_target
|
from netsleuth.cli import _dedupe, _os_timezone, parse_target
|
||||||
|
|
@ -59,7 +59,7 @@ def test_os_timezone_from_localtime_symlink(mock_path, monkeypatch):
|
||||||
monkeypatch.delenv("TZ", raising=False)
|
monkeypatch.delenv("TZ", raising=False)
|
||||||
mock_localtime = MagicMock()
|
mock_localtime = MagicMock()
|
||||||
mock_localtime.is_symlink.return_value = True
|
mock_localtime.is_symlink.return_value = True
|
||||||
mock_localtime.readlink.return_value = Path("/usr/share/zoneinfo/Europe/London")
|
mock_localtime.readlink.return_value = PurePosixPath("/usr/share/zoneinfo/Europe/London")
|
||||||
|
|
||||||
def side_effect(path, *args, **kwargs):
|
def side_effect(path, *args, **kwargs):
|
||||||
if str(path) == "/etc/localtime":
|
if str(path) == "/etc/localtime":
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue