예제 #1
0
def test_treeNoCycle3d():
    # Test 4 Prefixes of v for a tree
    crosPairgraph = get_disjoint_trees_no_cycle_3d()
    vertices = crosPairgraph.number_of_nodes()
    branchPoints = 2
    verticesListCrosses = _getLinePrefixes(crosPairgraph, "Tree.obj")
    assert verticesListCrosses[0] == vertices, "number of vertices in treeNoCycle3d obj {}, not {}".format(verticesListCrosses, vertices)
    assert verticesListCrosses[1] == branchPoints, "number of branch vertices in treeNoCycle3d obj {}, not {}".format(verticesListCrosses, branchPoints)
예제 #2
0
def test_treeNoCycle3D():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a tree like structure
    crosPairgraph = get_disjoint_trees_no_cycle_3d()
    stats = SegmentStats(crosPairgraph)
    stats.setStats()
    assert stats.totalSegments == 8, "totalSegments in treeNoCycle3D sample should be 8, it is {}".format(stats.totalSegments)
    assert stats.typeGraphdict[0] == 4, "type of graph in treeNoCycle3D sample should be 4, it is {}".format(stats.typeGraphdict[0])
    assert stats.countEndPoints == 8, "number of end points in treeNoCycle3D sample should be 2, it is {}".format(stats.countEndPoints)
    assert stats.countBranchPoints == 2, "number of branch points in treeNoCycle3D sample should be 2, it is {}".format(stats.countBranchPoints)
    assert stats.cycleInfoDict == {}, "cycleInfoDict must be empty, it is {}".format(stats.cycleInfoDict)
def test_treeNoCycle3d():
    # Test 4 Prefixes of v for a tree
    crosPairgraph = get_disjoint_trees_no_cycle_3d()
    vertices = crosPairgraph.number_of_nodes()
    branchPoints = 2
    verticesListCrosses = _getLinePrefixes(crosPairgraph, "Tree.obj")
    assert verticesListCrosses[
        0] == vertices, "number of vertices in treeNoCycle3d obj {}, not {}".format(
            verticesListCrosses, vertices)
    assert verticesListCrosses[
        1] == branchPoints, "number of branch vertices in treeNoCycle3d obj {}, not {}".format(
            verticesListCrosses, branchPoints)
예제 #4
0
def test_treeNoCycle3D():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a tree like structure
    crosPairgraph = get_disjoint_trees_no_cycle_3d()
    stats = SegmentStats(crosPairgraph)
    stats.setStats()
    assert stats.totalSegments == 8, "totalSegments in treeNoCycle3D sample should be 8, it is {}".format(
        stats.totalSegments)
    assert stats.typeGraphdict[
        0] == 4, "type of graph in treeNoCycle3D sample should be 4, it is {}".format(
            stats.typeGraphdict[0])
    assert stats.countEndPoints == 8, "number of end points in treeNoCycle3D sample should be 2, it is {}".format(
        stats.countEndPoints)
    assert stats.countBranchPoints == 2, "number of branch points in treeNoCycle3D sample should be 2, it is {}".format(
        stats.countBranchPoints)
    assert stats.cycleInfoDict == {}, "cycleInfoDict must be empty, it is {}".format(
        stats.cycleInfoDict)