def test_lollipop_graph(self):
        # number of nodes = m1 + m2
        # number of edges = number_of_edges(complete_graph(m1)) + m2
        for m1, m2 in [(3, 5), (4, 10), (3, 20)]:
            b=lollipop_graph(m1,m2)
            assert_equal(number_of_nodes(b), m1+m2)
            assert_equal(number_of_edges(b), m1*(1-m1)/2 + m2)
            assert_equal(b.name,
                         'lollipop_graph(' + str(m1) + ', ' + str(m2) + ')')

        # Raise NetworkXError if m<2
        assert_raises(networkx.exception.NetworkXError,
                      lollipop_graph, 1, 20)

        # Raise NetworkXError if n<0
        assert_raises(networkx.exception.NetworkXError,
                      lollipop_graph, 5, -2)

        # lollipop_graph(2,m) = path_graph(m+2)
        for m1, m2 in [(2, 5), (2, 10), (2, 20)]:
            b=lollipop_graph(m1,m2)
            assert_true(is_isomorphic(b, path_graph(m2+2)))

        assert_raises(networkx.exception.NetworkXError,
                      lollipop_graph, m1, m2, create_using=DiGraph())

        mb=lollipop_graph(m1, m2, create_using=MultiGraph())
        assert_equal(sorted(mb.edges()), sorted(b.edges()))

        g=lollipop_graph([1,2,3,4], "abc")
        assert_equal(len(g), 7)
        assert_equal(g.size(), 9)
dataset/ETHPy150Open networkx/networkx/networkx/generators/tests/test_classic.py/TestGeneratorClassic.test_lollipop_graph/swapped operands of `-`