def doB(self, p1): ''' This class is used to test the handling of the :seqdiag loop and :seqdiag loop end tags when more than one loop is declared in the same method. :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(3): c.doC1(p1) #:seqdiag_loop_start 3 times a += 1 # dummy instruction c.doC2(p1) #:seqdiag_loop_end a += 1 # dummy instruction for i in range(6): c.doC1(p1) #:seqdiag_loop_start_end 6 times a += 1 # dummy instruction c.doC2(p1) a += 1 # dummy instruction print(a) # another dummy instruction
def doB(self, p1): ''' This class is used to test the handling of the :seqdiag loop and :seqdiag loop end tags with two nested loops. The nested loop contains two calls to a leaf method. :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(3): a += 1 # dummy instruction for i in range(5): c.doC1( p1 ) #:seqdiag_loop_start 3 times :seqdiag_loop_start 5 times a += 1 # dummy instruction c.doC1(p1) #:seqdiag_loop_end a += 1 # dummy instruction c.doC2(p1) #:seqdiag_loop_end a += 1 # dummy instruction c.doC1(p1) print(a) # another dummy instruction
def doMidLoop1(self, p1): ''' Method with intermediate loop. ''' c = ClassLeaf() a = 0 for i in range(2): c.doC1(p1) #:seqdiag_loop_start_end 2 times a += 1 # dummy instruction
def doLoopStartAndLoopEndOnNotRecordedMethodCall(self, p1): ''' This method is used to test the handling of the :seqdiag loop start and :seqdiag loop end placed on a method which is not monitored by the SeqDiagBuilder.recordFlow() static method. :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(3): c.doC4NotRecordedInFlow(p1) #:seqdiag_loop_start 3 times a += 1 # dummy instruction c.doC4NotRecordedInFlow(p1) #:seqdiag_loop_end c.doC2(p1)
def doB(self, p1): c = ClassLeaf() a = 0 for i in range(3): a += 1 # dummy instruction for i in range(5): c.doCWithNote( p1 ) #:seqdiag_loop_start 3 times :seqdiag_loop_start_end 5 times a += 1 # dummy instruction a += 1 # dummy instruction c.doC2(p1) #:seqdiag_loop_end a += 1 # dummy instruction c.doC1(p1) print(a) # another dummy instruction
def doMidLoopLeafLoop(self, p1): ''' Method with intermediate loop calling leaf class methods with loop. ''' c = ClassLeaf() a = 0 for i in range(2): c.doCLoop(p1) #:seqdiag_loop_start 2 times a += 1 # dummy instruction c.doCLoopStartEnd(p1) #:seqdiag_loop_end
def doMidLoopSimple(self, p1): ''' Method with intermediate loop calling simple leaf methods. ''' c = ClassLeaf() a = 0 for i in range(3): c.doC1(p1) #:seqdiag_loop_start 3 times a += 1 # dummy instruction c.doC2(p1) #:seqdiag_loop_end
def doB(self, p1): c = ClassLeaf() a = 0 for i in range(3): a += 1 # dummy instruction for j in range(5): c.doCWithNote( p1 ) #:seqdiag_loop_start_end 3 times :seqdiag_loop_start_end 5 times c.doC1(p1)
def doB(self, p1): ''' :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(3): c.doC1(p1) #:seqdiag_loop_start 3 times a += 1 # dummy instruction c.doC2(p1) #:seqdiag_loop_end print(a) # another dummy instruction
def doB(self, p1): ''' This class is used to test the handling of the :seqdiag loop start end and :seqdiag loop end tags located on the same line. :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(2): a += 1 # dummy instruction for i in range(3): c.doC1( p1 ) #:seqdiag_loop_start 3 times :seqdiag_loop_start_end 2 times a += 1 # dummy instruction a += 1 # dummy instruction for j in range(2): c.doC2(p1) #:seqdiag_loop_start_end 2 times :seqdiag_loop_end a += 1 # dummy instruction c.doC3(p1)
def doB(self, p1): ''' This class is used to test the handling of the :seqdiag loop and :seqdiag loop end tags with a loop inside which only one method is called. :param p1: :return: ''' c = ClassLeaf() a = 0 for i in range(3): c.doC1(p1) #:seqdiag_loop_start_end 3 times a += 1 # dummy instruction c.doC2(p1) print(a) # another dummy instruction