예제 #1
0
def test_citnet_add_edge():
    """
    Check if an edge is added correctly
    """
    citnet = CitationNetwork()
    edge = ('1975NW.....62..309F', '1963RvMP...35..947B', 0)
    citnet.add_edge(edge)
    assert citnet.has_edge(edge)
예제 #2
0
def test_citnet_add_edge_two_times():
    """
    Make sure that no duplicates can be added
    """
    citnet = CitationNetwork()
    edge = ('1975NW.....62..309F', '1963RvMP...35..947B', 0)
    citnet.add_edge(edge)
    citnet.add_edge(edge)
    assert len(citnet.edges) == 1