コード例 #1
0
def test_size():

    graph = Graph()

    graph.add_node('apple')

    assert graph.size() == 1

    graph.add_node('banana')

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

    graph = Graph()

    expected = 0

    actual = graph.size()

    assert actual == expected
def test_proper_size_is_returned():
    g = Graph()
    g.add_node('a')
    g.add_node('b')
    g.add_node('c')
    g.add_node('d')

    actual = g.size()
    expected = 4
    assert expected == actual
コード例 #5
0
def test_size():
    gr = Graph()
    gr.add_node('ana')
    gr.add_node('3nde')
    gr.add_node('prop')
    gr.add_node('bl')
    gr.add_node('terminal')
    gr.add_node(',')
    gr.add_node('C.U..')

    assert gr.size() == 7
def test_size():

    graph = Graph()

    graph.add_node('hello')

    expected = 1

    actual = graph.size()

    assert actual == expected
コード例 #7
0
def test_size_empty():

    graph = Graph()

    assert graph.size() == 0