Created
May 3, 2012 22:23
-
-
Save dkuebric/2589976 to your computer and use it in GitHub Desktop.
testing foresight
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(venv)dan@dev1:~/code/oboe/test[master]$ cat !$ | |
cat test_python.py | |
""" Tests for Python high-level API. | |
No stack needed! | |
""" | |
from test import TestWebInstrumentation | |
from udplisten import get_events, get_trace, get_events_and_response | |
import oboe | |
import time | |
from oboeware import loader | |
class TestPython(TestWebInstrumentation): | |
def __init__(self, *args, **kwargs): | |
TestWebInstrumentation.__init__(self, *args, **kwargs) | |
loader.load_inst_modules() | |
def test_normal(self): | |
oboe.config['tracing_mode'] = 'always' | |
oboe.config['sample_rate'] = 1.0 | |
@oboe.Context.trace('test_normal') | |
def do_something(): | |
time.sleep(0.1) | |
events = self.get_events(do_something, 2) | |
self.assertEquals(len(events), 2) | |
self.assert_standard_trace(events) | |
self.assertTrue('test_normal' in self.get_layer_names(events)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment