import hug


def test_timer():
    timer = hug.directives.timer()
    assert isinstance(timer.taken(), float)
    assert isinstance(timer.start, float)

    timer = hug.directives.timer('Time: {0}')
    assert isinstance(timer.taken(), str)
    assert isinstance(timer.start, float)

import sys
import hug

api = sys.modules[__name__]


def test_timer():
    timer = hug.directives.timer()
    assert isinstance(timer.taken(), float)
    assert isinstance(timer.start, float)

    timer = hug.directives.timer('Time: {0}')
    assert isinstance(timer.taken(), str)
    assert isinstance(timer.start, float)

    @hug.get()
    def timer_tester(timer):
        return timer.taken()

    assert isinstance(hug.test.get(api, 'timer_tester').data, float)

Add test for timer automatically inserted due to directive
Add test for timer automatically inserted due to directive

+ import sys
  import hug
+ 
+ api = sys.modules[__name__]
  
  
  def test_timer():
      timer = hug.directives.timer()
      assert isinstance(timer.taken(), float)
      assert isinstance(timer.start, float)
  
      timer = hug.directives.timer('Time: {0}')
      assert isinstance(timer.taken(), str)
      assert isinstance(timer.start, float)
  
+     @hug.get()
+     def timer_tester(timer):
+         return timer.taken()
+ 
+     assert isinstance(hug.test.get(api, 'timer_tester').data, float)
+ 
Add test for timer automatically inserted due to directive
## Code Before:
import hug


def test_timer():
    timer = hug.directives.timer()
    assert isinstance(timer.taken(), float)
    assert isinstance(timer.start, float)

    timer = hug.directives.timer('Time: {0}')
    assert isinstance(timer.taken(), str)
    assert isinstance(timer.start, float)

## Instruction:
Add test for timer automatically inserted due to directive
## Code After:
import sys
import hug

api = sys.modules[__name__]


def test_timer():
    timer = hug.directives.timer()
    assert isinstance(timer.taken(), float)
    assert isinstance(timer.start, float)

    timer = hug.directives.timer('Time: {0}')
    assert isinstance(timer.taken(), str)
    assert isinstance(timer.start, float)

    @hug.get()
    def timer_tester(timer):
        return timer.taken()

    assert isinstance(hug.test.get(api, 'timer_tester').data, float)
