コード例 #1
0
def test_size():
    graph = Graph()
    a = graph.add_node('a')
    b = graph.add_node('b')
    expected = 2
    actual = graph.size()
    assert actual == expected
コード例 #2
0
def test_size_empty():

    graph = Graph()

    expected = 0

    actual = graph.size()

    assert actual == expected
コード例 #3
0
def test_size_one():

    graph = Graph()

    graph.add_node("spam")

    expected = 1

    actual = graph.size()

    assert actual == expected
コード例 #4
0
def test_size_two():

    graph = Graph()

    graph.add_node("spam")

    graph.add_node("bacon")

    expected = 2

    actual = graph.size()

    assert actual == expected