def test_get_documentation_in_alphabetical_order(): file_metadata = Base.read_file("test_data/module.py") doc = doksit._get_documentation(file_metadata) assert doc.index("class Bar") < doc.index("class Foo") assert doc.index("property variable") < doc.index("method method") assert doc.index("function another_function") \ < doc.index("function function")
def test_get_documentation_for_module_with_template_variables(): file_metadata = Base.read_file("test_data/named_objects_a.py") doc = doksit._get_documentation(file_metadata) assert "test_data.named_objects_b" not in doc assert "## Blabla" in doc
def test_get_documentation_for_blank_file(): file_metadata = Base.read_file("test_data/blank.py") doc = doksit._get_documentation(file_metadata) assert doc is None
def file_metadata(): return Base.read_file("test_data/module.py")