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
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