def test_singleCycle(): # Test 2 Prefixes of v for a single cycle donutGraph = get_cycle_no_tree() vertices = donutGraph.number_of_nodes() branchPoints = 0 verticesListCycle = _getLinePrefixes(donutGraph, "OneCycle.obj") assert verticesListCycle[0] == vertices, "number of vertices in single cycle obj {}, not {}".format(verticesListCycle[0], vertices) assert verticesListCycle[1] == branchPoints, "number of branch vertices in single cycle obj {}, not {}".format(verticesListCycle[1], branchPoints)
def test_singleCycle(): # test if stats i.e segments, type of graph. branch, end points, and information about cycle # is as expected for a single cycle donutGraph = get_cycle_no_tree() stats = SegmentStats(donutGraph) stats.setStats() assert stats.totalSegments == 1, "totalSegments in singleCycle sample should be 1, it is {}".format(stats.totalSegments) assert stats.typeGraphdict[0] == 1, "type of graph in singleCycle sample should be 1, it is {}".format(stats.typeGraphdict[0]) assert stats.countEndPoints == 0, "number of end points in singleCycle sample should be 2, it is {}".format(stats.countEndPoints) assert stats.countBranchPoints == 0, "number of branch points in singleCycle sample should be 0, it is {}".format(stats.countBranchPoints) assert stats.hausdorffDimensionDict == {}, "hausdorffDimensionDict must be empty, it is {}".format(stats.hausdorffDimensionDict) assert stats.cycleInfoDict[0][0] == 0, "number of branch points on the cycle must be 0, it is {}".format(stats.cycleInfoDict[0][0])
def test_singleCycle(): # Test 2 Prefixes of v for a single cycle donutGraph = get_cycle_no_tree() vertices = donutGraph.number_of_nodes() branchPoints = 0 verticesListCycle = _getLinePrefixes(donutGraph, "OneCycle.obj") assert verticesListCycle[ 0] == vertices, "number of vertices in single cycle obj {}, not {}".format( verticesListCycle[0], vertices) assert verticesListCycle[ 1] == branchPoints, "number of branch vertices in single cycle obj {}, not {}".format( verticesListCycle[1], branchPoints)
def test_singleCycle(): # test if stats i.e segments, type of graph. branch, end points, and information about cycle # is as expected for a single cycle donutGraph = get_cycle_no_tree() stats = SegmentStats(donutGraph) stats.setStats() assert stats.totalSegments == 1, "totalSegments in singleCycle sample should be 1, it is {}".format( stats.totalSegments) assert stats.typeGraphdict[ 0] == 1, "type of graph in singleCycle sample should be 1, it is {}".format( stats.typeGraphdict[0]) assert stats.countEndPoints == 0, "number of end points in singleCycle sample should be 2, it is {}".format( stats.countEndPoints) assert stats.countBranchPoints == 0, "number of branch points in singleCycle sample should be 0, it is {}".format( stats.countBranchPoints) assert stats.hausdorffDimensionDict == {}, "hausdorffDimensionDict must be empty, it is {}".format( stats.hausdorffDimensionDict) assert stats.cycleInfoDict[0][ 0] == 0, "number of branch points on the cycle must be 0, it is {}".format( stats.cycleInfoDict[0][0])