Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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