File: test_hdfs.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 (23 lines) | stat: -rw-r--r-- 640 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
"""see upath/tests/conftest.py for fixtures"""

import pytest  # noqa: F401

from upath import UPath
from upath.implementations.hdfs import HDFSPath

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


@pytest.mark.hdfs
class TestUPathHDFS(BaseTests, metaclass=OverrideMeta):
    @pytest.fixture(autouse=True)
    def path(self, local_testdir, hdfs):
        host, user, port = hdfs
        path = f"hdfs:{local_testdir}"
        self.path = UPath(path, host=host, user=user, port=port)

    @overrides_base
    def test_is_correct_class(self):
        assert isinstance(self.path, HDFSPath)