'Tests that the extended BA random graph generated behaves consistenly.
Tests the exceptions are raised as expected.
The graphs generation are repeated several times to prevent lucky-shots'

def test_extended_barabasi_albert(self, m=2):

    seed = 42
    repeats = 2
    BA_model = barabasi_albert_graph(100, m, seed)
    BA_model_edges = BA_model.number_of_edges()
    while repeats:
        repeats -= 1
        G1 = extended_barabasi_albert_graph(100, m, 0, 0, seed)
        assert_equal(G1.size(), BA_model_edges)
        G1 = extended_barabasi_albert_graph(100, m, 0.8, 0, seed)
        assert_greater(G1.size(), (BA_model_edges * 2))
        G2 = extended_barabasi_albert_graph(100, m, 0, 0.8, seed)
        assert_equal(G2.size(), BA_model_edges)
        G3 = extended_barabasi_albert_graph(100, m, 0.3, 0.3, seed)
        assert_greater(G3.size(), G2.size())
        assert_less(G3.size(), G1.size())
    ebag = extended_barabasi_albert_graph
    assert_raises(NetworkXError, ebag, m, m, 0, 0)
    assert_raises(NetworkXError, ebag, 1, 0.5, 0, 0)
    assert_raises(NetworkXError, ebag, 100, 2, 0.5, 0.5)
