def test_base_formatter_when_base_dir_is_given_and_relative_is_true(path, base_dir):
    # Given
    base_formatter = BaseFormatter(base_dir, True)

    # When
    output_path = base_formatter._format_path(path)

    # Then
    assert isinstance(output_path, str)
    assert isinstance(base_formatter._base_dir, str)
    assert output_path == Path(path).name
def test_base_formatter_when_base_dir(base_dir, relative_path, path):
    # Given
    base_formatter = BaseFormatter(base_dir, relative_path)

    # When
    output_path = base_formatter._format_path(path)

    # Then
    assert isinstance(output_path, str)
    assert base_formatter._base_dir is None or isinstance(base_formatter._base_dir, str)
    assert output_path == str(path)
Example #3
0
def test_base_formatter_when_base_dir_is_given_and_relative_is_true(
        path: Union[str, Path], base_dir: Union[str, Path]) -> None:
    # Given
    base_formatter = BaseFormatter(base_dir, True)  # type: ignore

    # When
    output_path = base_formatter._format_path(path)

    # Then
    assert isinstance(output_path, str)
    assert isinstance(base_formatter._base_dir, str)
    assert output_path == Path(path).name
Example #4
0
def test_base_formatter_when_base_dir(base_dir: Any, relative_path: bool,
                                      path: str) -> None:
    # Given
    base_formatter = BaseFormatter(base_dir, relative_path)  # type: ignore

    # When
    output_path = base_formatter._format_path(path)

    # Then
    assert isinstance(output_path, str)
    assert base_formatter._base_dir is None or isinstance(
        base_formatter._base_dir, str)
    assert output_path == str(path)