예제 #1
0
    def test5(self):
        "Test incrementing multiple dedicated counters."

        seq = Sequencer()
        startMyCounter0 = seq._this('myCounter0')
        startMyCounter1 = seq._this('myCounter1')

        for i in range(1, 101):
            n = seq.next('myCounter0')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter0') == n, msg
            m = seq.next('myCounter1')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter1') == m, msg
예제 #2
0
    def testChain(self):
        "Test auto resetting of subsections"
        seq = Sequencer()
        seq.chain('h1', 'h2')  #creates them and links
        self.assertEquals(seq.next('h1'), 1)
        self.assertEquals(seq.next('h1'), 2)
        self.assertEquals(seq.next('h2'), 1)
        self.assertEquals(seq.next('h2'), 2)
        self.assertEquals(seq.next('h2'), 3)

        #start chapter 3
        self.assertEquals(seq.next('h1'), 3)
        #...and the first section should be numbered 1, not 4
        self.assertEquals(seq.next('h2'), 1)        
    def test5(self):
        "Test incrementing multiple dedicated counters."

        seq = Sequencer()
        startMyCounter0 = seq._this('myCounter0')
        startMyCounter1 = seq._this('myCounter1')

        for i in range(1, 101):
            n = seq.next('myCounter0')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter0') == n, msg
            m = seq.next('myCounter1')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter1') == m, msg
예제 #4
0
    def testChain(self):
        "Test auto resetting of subsections"
        seq = Sequencer()
        seq.chain('h1', 'h2')  #creates them and links
        self.assertEquals(seq.next('h1'), 1)
        self.assertEquals(seq.next('h1'), 2)
        self.assertEquals(seq.next('h2'), 1)
        self.assertEquals(seq.next('h2'), 2)
        self.assertEquals(seq.next('h2'), 3)

        #start chapter 3
        self.assertEquals(seq.next('h1'), 3)
        #...and the first section should be numbered 1, not 4
        self.assertEquals(seq.next('h2'), 1)        
예제 #5
0
    def test3(self):
        "Test incrementing dedicated counter."

        seq = Sequencer()

        for i in range(1, 101):
            n = seq.next('myCounter1')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter1') == n, msg
예제 #6
0
    def test1(self):
        "Test incrementing default counter."

        seq = Sequencer()

        for i in range(1, 101):
            n = seq.next()
            msg = 'Sequence value is not correct!'
            assert seq._this() == n, msg
    def test3(self):
        "Test incrementing dedicated counter."

        seq = Sequencer()

        for i in range(1, 101):
            n = seq.next('myCounter1')
            msg = 'Sequence value is not correct!'
            assert seq._this('myCounter1') == n, msg
    def test1(self):
        "Test incrementing default counter."

        seq = Sequencer()

        for i in range(1, 101):
            n = seq.next()
            msg = 'Sequence value is not correct!'
            assert seq._this() == n, msg
예제 #9
0
    def test4(self):
        "Test resetting dedicated counter."

        seq = Sequencer()
        start = seq._this('myCounter1')

        for i in range(1, 101):
            n = seq.next('myCounter1')

        seq.reset('myCounter1')

        msg = 'Sequence value not correctly reset!'
        assert seq._this('myCounter1') == start, msg
예제 #10
0
    def test2(self):
        "Test resetting default counter."

        seq = Sequencer()
        start = seq._this()

        for i in range(1, 101):
            n = seq.next()

        seq.reset()

        msg = 'Sequence value not correctly reset!'
        assert seq._this() == start, msg
    def test4(self):
        "Test resetting dedicated counter."

        seq = Sequencer()
        start = seq._this('myCounter1')

        for i in range(1, 101):
            n = seq.next('myCounter1')

        seq.reset('myCounter1')

        msg = 'Sequence value not correctly reset!'
        assert seq._this('myCounter1') == start, msg
    def test2(self):
        "Test resetting default counter."

        seq = Sequencer()
        start = seq._this()

        for i in range(1, 101):
            n = seq.next()

        seq.reset()

        msg = 'Sequence value not correctly reset!'
        assert seq._this() == start, msg