示例#1
0
    def test_new_by_incr(self):
        with pytest.raises(Exception):
            CounterStatLogic.get(self.counter_name).one()

        CounterStatLogic.incr(self.counter_name, self.counter_type)
        self.db.session.commit()
        csl = CounterStatLogic.get(self.counter_name).one()
        assert csl.counter == 1
示例#2
0
    def test_new_by_incr(self):
        with pytest.raises(Exception):
            CounterStatLogic.get(self.counter_name).one()

        CounterStatLogic.incr(self.counter_name, self.counter_type)
        self.db.session.commit()
        csl = CounterStatLogic.get(self.counter_name).one()
        assert csl.counter == 1
示例#3
0
 def test_counter_basic(self):
     CounterStatLogic.add(self.counter_name, self.counter_type)
     self.db.session.commit()
     CounterStatLogic.incr(self.counter_name, self.counter_type)
     self.db.session.commit()
     csl = CounterStatLogic.get(self.counter_name).one()
     assert csl.counter == 1
示例#4
0
 def test_counter_basic(self):
     CounterStatLogic.add(self.counter_name, self.counter_type)
     self.db.session.commit()
     CounterStatLogic.incr(self.counter_name, self.counter_type)
     self.db.session.commit()
     csl = CounterStatLogic.get(self.counter_name).one()
     assert csl.counter == 1