Exemple #1
0
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")
Exemple #2
0
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
Exemple #3
0
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
Exemple #4
0
def file_metadata():
    return Base.read_file("test_data/module.py")