def METHOD_NAME(self):
    data = {2: set([11]),
            9: set([11, 8]),
            10: set([11, 3]),
            11: set([7, 5]),
            8: set([7, 3, 8]),  # includes something self-referential
            }
    expected = [set([3, 5, 7]), set([8, 11]), set([2, 9, 10])]
    assert list(toposort(data)) == expected
    # now check the sorted results
    results = []
    for item in expected:
        results.extend(sorted(item))
    assert toposort_flatten(data) == results
    # and the unsorted results. break the results up into groups to compare them
    actual = toposort_flatten(data, False)
    results = [set([i for i in actual[0:3]]), set([i for i in actual[3:5]]), set([i for i in actual[5:8]])]
    assert results == expected