Example #1
0
def SourceIsEdgeOnly_test():
    os.chdir('/Users/Looi/Desktop/MyRepo/HW04_Alooi/data')
    NCAA = read_edgelist("NCAA_2005.edgelist", delimitedby='" "')
    # case where originating node is not in a graph obj.
    obs = connected_nodes(NCAA, "Navy")
    exp = False
    # capture standard out
    assert_equal(exp, obs)
Example #2
0
def SourceIsListConnectedNodes_test():
    os.chdir('/Users/Looi/Desktop/MyRepo/HW04_Alooi/data')
    NCAA = read_edgelist("NCAA_2005.edgelist", delimitedby='" "')
    # case where originating node is not in a graph obj.
    obs = set(connected_nodes(NCAA, ["TCU"]))
    exp = set([
        'TCU', 'Nebraska', 'Houston', 'Brigham Young', 'Hawaii',
        'Boston College', 'Nevada', 'UNLV', 'San Diego St.', 'Virginia Tech',
        'Virginia', 'Missouri'
    ])
    # capture standard out
    assert_equal(exp, obs)
Example #3
0
def NCAA_setup():
    NCAA = read_edgelist("NCAA_2005.edgelist", delimitedby='" "')