1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-07-29 18:08:31 +00:00

Use sys.platform instead of os.name

mypy only recognizes sys.platform
This commit is contained in:
Unrud 2022-02-01 17:53:46 +01:00
parent 066cefcc17
commit c50039e878
7 changed files with 21 additions and 33 deletions

View file

@ -22,7 +22,6 @@ Tests for storage backends.
import os
import shutil
import sys
from typing import ClassVar, cast
import pytest
@ -100,8 +99,6 @@ class TestMultiFileSystem(BaseTest):
assert answer1 == answer2
assert os.path.exists(os.path.join(cache_folder, "event1.ics"))
@pytest.mark.skipif(os.name != "posix" and sys.platform != "win32",
reason="Only supported on 'posix' and 'win32'")
def test_put_whole_calendar_uids_used_as_file_names(self) -> None:
"""Test if UIDs are used as file names."""
_TestBaseRequests.test_put_whole_calendar(
@ -110,8 +107,6 @@ class TestMultiFileSystem(BaseTest):
_, answer = self.get("/calendar.ics/%s.ics" % uid)
assert "\r\nUID:%s\r\n" % uid in answer
@pytest.mark.skipif(os.name != "posix" and sys.platform != "win32",
reason="Only supported on 'posix' and 'win32'")
def test_put_whole_calendar_random_uids_used_as_file_names(self) -> None:
"""Test if UIDs are used as file names."""
_TestBaseRequests.test_put_whole_calendar_without_uids(
@ -127,8 +122,6 @@ class TestMultiFileSystem(BaseTest):
assert answer is not None
assert "\r\nUID:%s\r\n" % uid in answer
@pytest.mark.skipif(os.name != "posix" and sys.platform != "win32",
reason="Only supported on 'posix' and 'win32'")
def test_put_whole_addressbook_uids_used_as_file_names(self) -> None:
"""Test if UIDs are used as file names."""
_TestBaseRequests.test_put_whole_addressbook(
@ -137,8 +130,6 @@ class TestMultiFileSystem(BaseTest):
_, answer = self.get("/contacts.vcf/%s.vcf" % uid)
assert "\r\nUID:%s\r\n" % uid in answer
@pytest.mark.skipif(os.name != "posix" and sys.platform != "win32",
reason="Only supported on 'posix' and 'win32'")
def test_put_whole_addressbook_random_uids_used_as_file_names(
self) -> None:
"""Test if UIDs are used as file names."""