Exemple #1
0
    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)
Exemple #2
0
 def test_unset(self):
     self.create({'unset': ['a', 'c']}, [Event(a=1, b=2)])
     q = self.wait()
     assertEventEquals(self, Event(b=2), q[0])
Exemple #3
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])
Exemple #4
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])