コード例 #1
0
def test_cycleAndTree():
    # Test 3 Prefixes of v for a cyclic tree
    sampleGraph = get_cycles_with_branches_protrude()
    vertices = sampleGraph.number_of_nodes()
    branchPoints = 2
    verticesListCyclicTree = _getLinePrefixes(sampleGraph, "CycleAndTree.obj")
    assert verticesListCyclicTree[0] == vertices, "number of vertices in cycleAndTree obj {}, not {}".format(verticesListCyclicTree[0], vertices)
    assert verticesListCyclicTree[1] == branchPoints, "number of branch vertices in cycleAndTree obj {}, not {}".format(verticesListCyclicTree[1], branchPoints)
コード例 #2
0
def test_cycleAndTree():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a cyclic tree
    sampleGraph = get_cycles_with_branches_protrude()
    stats = SegmentStats(sampleGraph)
    stats.setStats()
    assert stats.totalSegments == 4, "totalSegments in cycleAndTree sample should be 4, it is {}".format(stats.totalSegments)
    assert stats.typeGraphdict[0] == 3, "type of graph in cycleAndTree sample should be 3, it is {}".format(stats.typeGraphdict[0])
    assert stats.countEndPoints == 2, "number of end points in cycleAndTree sample should be 2, it is {}".format(stats.countEndPoints)
    assert stats.countBranchPoints == 2, "number of branch points in cycleAndTree sample should be 2, it is {}".format(stats.countBranchPoints)
    assert stats.cycleInfoDict[0][0] == 2, "number of branch points on the cycle must be 2, it is {}".format(stats.cycleInfoDict[0][0])
コード例 #3
0
def test_cycleAndTree():
    # Test 3 Prefixes of v for a cyclic tree
    sampleGraph = get_cycles_with_branches_protrude()
    vertices = sampleGraph.number_of_nodes()
    branchPoints = 2
    verticesListCyclicTree = _getLinePrefixes(sampleGraph, "CycleAndTree.obj")
    assert verticesListCyclicTree[
        0] == vertices, "number of vertices in cycleAndTree obj {}, not {}".format(
            verticesListCyclicTree[0], vertices)
    assert verticesListCyclicTree[
        1] == branchPoints, "number of branch vertices in cycleAndTree obj {}, not {}".format(
            verticesListCyclicTree[1], branchPoints)
コード例 #4
0
def test_cycleAndTree():
    # test if stats i.e segments, type of graph. branch, end points, and information about cycle
    # is as expected for a cyclic tree
    sampleGraph = get_cycles_with_branches_protrude()
    stats = SegmentStats(sampleGraph)
    stats.setStats()
    assert stats.totalSegments == 4, "totalSegments in cycleAndTree sample should be 4, it is {}".format(
        stats.totalSegments)
    assert stats.typeGraphdict[
        0] == 3, "type of graph in cycleAndTree sample should be 3, it is {}".format(
            stats.typeGraphdict[0])
    assert stats.countEndPoints == 2, "number of end points in cycleAndTree sample should be 2, it is {}".format(
        stats.countEndPoints)
    assert stats.countBranchPoints == 2, "number of branch points in cycleAndTree sample should be 2, it is {}".format(
        stats.countBranchPoints)
    assert stats.cycleInfoDict[0][
        0] == 2, "number of branch points on the cycle must be 2, it is {}".format(
            stats.cycleInfoDict[0][0])