Esempio n. 1
0
def test_render_data_to_json():
    t = random.randint(0, 10)
    v = random.random()
    e = data.Data("foobar", v, t)
    eq_({
        "name": e.name(),
        "value": e.value(),
        "timestamp": e.unixtimestamp()
    }, pp.render_storable_to_json(e))
Esempio n. 2
0
def test_render_data_to_json():
    t = random.randint(0, 10)
    v = random.random()
    e = data.Data("foobar", v, t)
    eq_({"name": e.name(), "value": e.value(), "timestamp": e.unixtimestamp()}, pp.render_storable_to_json(e))
Esempio n. 3
0
 def on_core_recv_event(self, e):
     logger.debug("core_recv_event: %s" % e)
     msg = {"results": {"event": pp.render_storable_to_json(e)}}
     msg.update(pp.render_storable_to_json(e)) # do not break compatibility with previous versions
     self._sendmsg(200, msg)