File: test_absolute_path_factory.py

package info (click to toggle)
python-pytest-resource-path 1.3.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 192 kB
  • sloc: python: 398; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 754 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""Tests for absolute_path_factory.py"""
from pathlib import Path

from pytest_resource_path.absolute_path_factory import AbsolutePathFactory
from tests.testlibraries.function_getter import FunctionGetter


class TestAbsolutePathFactory:
    """Tests for AbsolutePathFactory"""

    @staticmethod
    def test_create_absolute_path_tests(testdir_structure):
        """Method create_absolute_path() should return absolute path."""
        file_name_pytest = "test_module_something"
        function = FunctionGetter.get(file_name_pytest, testdir_structure)
        # noinspection PyProtectedMember
        path = AbsolutePathFactory(Path("tests")).create_by_function(function)
        assert path.is_absolute() is True
        assert path.name == "tests"