def test_log(self): conf = {'address': 'ipc://testipc2', 'mode': 'connect', 'socket': 'PUSH'} self.create(conf) # create a zeromq socket ctx = zmq.Context() sock = ctx.socket(zmq.PULL) sock.bind(conf['address']) ev = Event(field='x') self.input.put(ev) self.waitForEmpty() data = sock.recv() self.assertEquals(ev.to_json(), data)
def test_unset(self): self.create({'unset': ['a', 'c']}, [Event(a=1, b=2)]) q = self.wait() assertEventEquals(self, Event(b=2), q[0])
def test_match(self): self.create({'field': 'data'}, [Event(data='abc?a=1%2C2&b=2+3')]) q = self.wait() assertEventEquals(self, Event(path='abc', a='1,2', b='2 3'), q[0])
def test_copy(self): self.create({'copy': {'b': 'a', 'd': 'c'}}, [Event(a=1, c=5)]) q = self.wait() assertEventEquals(self, Event(b=1, a=1, c=5, d=5), q[0])