def test_dependency_graph_single_page():
    """confirms that `dependency_graph(Base)` will return a dependency graph
    consisting of only dependencies and dependencies of dependencies (if any)
    """
    desired = {}
    desired[G] = set([D])
    desired[D] = set([A])
    desired[A] = set()
    assert has_create.dependency_graph(G) == desired
def test_dependency_graph_page_with_optional():
    """confirms that `dependency_graph(Base, OptionalBase)` will return a dependency
    graph consisting of only dependencies and dependencies of dependencies (if any)
    with the exception that the OptionalBase and its dependencies are included as well.
    """
    desired = {}
    desired[G] = set([D])
    desired[E] = set([D, C])
    desired[C] = set([A, B])
    desired[D] = set([A])
    desired[B] = set()
    desired[A] = set()
    assert has_create.dependency_graph(G, E) == desired
def test_dependency_graph_page_with_additionals():
    """confirms that `dependency_graph(Base, AdditionalBaseOne, AdditionalBaseTwo)`
    will return a dependency graph consisting of only dependencies and dependencies
    of dependencies (if any) with the exception that the AdditionalBases
    are treated as a dependencies of Base (when they aren't) and their dependencies
    are included as well.
    """
    desired = {}
    desired[E] = set([D, C])
    desired[D] = set([A])
    desired[C] = set([A, B])
    desired[F] = set([B])
    desired[G] = set([D])
    desired[A] = set()
    desired[B] = set()
    assert has_create.dependency_graph(E, F, G) == desired