# Path: uqbar/strings.py
# def normalize(string: str) -> str:
#     """
#     Normalizes whitespace.
# 
#     Strips leading and trailing blank lines, dedents, and removes trailing
#     whitespace from the result.
#     """
#     string = string.replace("\t", "    ")
#     lines = string.split("\n")
#     while lines and (not lines[0] or lines[0].isspace()):
#         lines.pop(0)
#     while lines and (not lines[-1] or lines[-1].isspace()):
#         lines.pop()
#     for i, line in enumerate(lines):
#         lines[i] = line.rstrip()
#     string = "\n".join(lines)
#     string = textwrap.dedent(string)
#     return string


import pathlib
import sys
import pytest
import uqbar.apis
from uqbar.strings import normalize
def test_path():
    test_path = pathlib.Path(__file__).parent
    if str(test_path) not in sys.path:
        sys.path.insert(0, str(test_path))


def test_str_01(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module.PublicClass")
    assert normalize(str(documenter)) == normalize(
        """
        .. autoclass:: PublicClass
           :members:
           :undoc-members:
        """
    )


def test_str_02(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module.ChildClass")
    assert normalize(str(documenter)) == normalize(
        """
        .. autoclass:: ChildClass
           :members:
           :undoc-members:
        """
    )


def test_str_03(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module._PrivateClass")

# Path: uqbar/strings.py
# def normalize(string: str) -> str:
#     """
#     Normalizes whitespace.
# 
#     Strips leading and trailing blank lines, dedents, and removes trailing
#     whitespace from the result.
#     """
#     string = string.replace("\t", "    ")
#     lines = string.split("\n")
#     while lines and (not lines[0] or lines[0].isspace()):
#         lines.pop(0)
#     while lines and (not lines[-1] or lines[-1].isspace()):
#         lines.pop()
#     for i, line in enumerate(lines):
#         lines[i] = line.rstrip()
#     string = "\n".join(lines)
#     string = textwrap.dedent(string)
#     return string


# Path: tests/test_apis_ClassDocumenter.py
import pathlib
import sys
import pytest
import uqbar.apis
from uqbar.strings import normalize

def test_path():
    test_path = pathlib.Path(__file__).parent
    if str(test_path) not in sys.path:
        sys.path.insert(0, str(test_path))


def test_str_01(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module.PublicClass")
    assert normalize(str(documenter)) == normalize(
        """
        .. autoclass:: PublicClass
           :members:
           :undoc-members:
        """
    )


def test_str_02(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module.ChildClass")
    assert normalize(str(documenter)) == normalize(
        """
        .. autoclass:: ChildClass
           :members:
           :undoc-members:
        """
    )


def test_str_03(test_path):
    documenter = uqbar.apis.ClassDocumenter("fake_package.module._PrivateClass")

    assert normalize(str(documenter)) == normalize(