Skip to content

Commit 6048957

Browse files
committed
skip root-only perm bad filename check on Windows
1 parent 5ecbc5c commit 6048957

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tests/test_libzim_creator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env python
2+
from __future__ import annotations
23

34
import base64
45
import datetime
56
import itertools
67
import os
78
import pathlib
9+
import platform
810
import subprocess
911
import sys
10-
from typing import Dict
11-
12-
import pytest
1312

1413
import libzim.writer
14+
import pytest
1515
from libzim.reader import Archive
1616
from libzim.search import Query, Searcher
1717
from libzim.suggestion import SuggestionSearcher
@@ -49,7 +49,7 @@ def get_contentprovider(self) -> libzim.writer.ContentProvider:
4949
return FileProvider(filepath=self.filepath)
5050
return StringProvider(content=getattr(self, "content", ""))
5151

52-
def get_hints(self) -> Dict[Hint, int]:
52+
def get_hints(self) -> dict[Hint, int]:
5353
return getattr(self, "hints", {Hint.FRONT_ARTICLE: True})
5454

5555

@@ -805,7 +805,7 @@ def get_contentprovider(self):
805805

806806

807807
def test_creator_badfilename(tmpdir):
808-
if os.getuid() != 0:
808+
if platform.system() != "Windows" and os.getuid() != 0:
809809
# lack of perm
810810
with pytest.raises(IOError):
811811
Creator("/root/test.zim")

0 commit comments

Comments
 (0)