File: test_smb.py

package info (click to toggle)
universal-pathlib 0.3.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,656 kB
  • sloc: python: 20,552; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 943 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pytest

from upath import UPath

from ..cases import BaseTests
from ..utils import OverrideMeta
from ..utils import overrides_base
from ..utils import skip_on_windows


@skip_on_windows
class TestUPathSMB(BaseTests, metaclass=OverrideMeta):

    @pytest.fixture(autouse=True)
    def path(self, smb_fixture):
        self.path = UPath(smb_fixture)

    @overrides_base
    def test_is_correct_class(self):
        from upath.implementations.smb import SMBPath

        assert isinstance(self.path, SMBPath)

    @overrides_base
    @pytest.mark.parametrize(
        "pattern",
        (
            "*.txt",
            pytest.param(
                "*",
                marks=pytest.mark.xfail(
                    reason="SMBFileSystem.info appends '/' to dirs"
                ),
            ),
            "**/*.txt",
        ),
    )
    def test_glob(self, pathlib_base, pattern):
        super().test_glob(pathlib_base, pattern)