# Path: tests/local/base.py
# class StatsTest(unittest.TestCase):
#     def setUp(self):
#         self.registry = Registry()


from time import sleep
from tests.local.base import StatsTest
import fudge




class TimerTestCase(StatsTest):
    @fudge.patch('tapes.local.meter.time')
    def test_timer_has_meter(self, meter_time):
        (meter_time
         # initialize Meter
         .expects_call().returns(1.0)
         # mark()
         .next_call().returns(60.0)
         # mark()
         .next_call().returns(5 * 60.0)
         # mark()
         .next_call().returns(15 * 60.0)
         # get_stats()
         .next_call().returns(15 * 60.0)
         .next_call().returns(15 * 60.0)
         .next_call().returns(15 * 60.0))

        timer = self.registry.timer('TimerTestCase.test_timer_has_meter')

        with timer.time():
            pass

        with timer.time():
            pass

        with timer.time():

# Path: tests/local/base.py
# class StatsTest(unittest.TestCase):
#     def setUp(self):
#         self.registry = Registry()


# Path: tests/local/test_timer.py
from time import sleep
from tests.local.base import StatsTest
import fudge





class TimerTestCase(StatsTest):
    @fudge.patch('tapes.local.meter.time')
    def test_timer_has_meter(self, meter_time):
        (meter_time
         # initialize Meter
         .expects_call().returns(1.0)
         # mark()
         .next_call().returns(60.0)
         # mark()
         .next_call().returns(5 * 60.0)
         # mark()
         .next_call().returns(15 * 60.0)
         # get_stats()
         .next_call().returns(15 * 60.0)
         .next_call().returns(15 * 60.0)
         .next_call().returns(15 * 60.0))

        timer = self.registry.timer('TimerTestCase.test_timer_has_meter')

        with timer.time():
            pass

        with timer.time():
            pass

        with timer.time():

            pass