def test_pass_float(self): """Pass float through queue. 1.) Send float into queue 2.) Receive from queue => Received data should equal the sent data.""" msgq.msgsnd(self.id, 0, 2.0) self.assertEqual(msgq.msgrcv(self.id, 0), 2.0)
def test_pass_long(self): """Pass long through queue. 1.) Send long into queue 2.) Receive from queue => Received data should equal the sent data.""" msgq.msgsnd(self.id, 0, 2 ** 32L) self.assertEqual(msgq.msgrcv(self.id, 0), 2 ** 32L)
def test_pass_none(self): """Pass None through queue. 1.) Send None into queue 2.) Receive from queue => We should get None back.""" msgq.msgsnd(self.id, 0, None) self.assertEqual(msgq.msgrcv(self.id, 0), None)
def test_pass_long(self): """Pass long through queue. 1.) Send long into queue 2.) Receive from queue => Received data should equal the sent data.""" msgq.msgsnd(self.id, 0, 2**32L) self.assertEqual(msgq.msgrcv(self.id, 0), 2**32L)
def test_pass_string(self): """Pass string through queue. 1.) Send string into queue 2.) Receive from queue => Received data should equal the sent data. """ data = "Ad astra per alia porci" msgq.msgsnd(self.id, 0, data) self.assertEqual(msgq.msgrcv(self.id, 0), data)
def test_pass_set(self): """Pass set through queue. 1.) Send set into queue 2.) Receive from queue => Received data should equal the sent data. """ data = set([1, 7, 9, 13]) msgq.msgsnd(self.id, 0, data) self.assertEqual(msgq.msgrcv(self.id, 0), data)
def test_pass_tuple(self): """Pass tuple through queue. 1.) Send tuple into queue 2.) Receive from queue => Received data should equal the sent data. """ data = (1, 2, "foo", None) msgq.msgsnd(self.id, 0, data) self.assertEqual(msgq.msgrcv(self.id, 0), data)
def test_pass_dictonary(self): """Pass dictonary through queue. 1.) Send dicontary into queue 2.) Receive from queue => Received data should equal the sent data. """ data = {1: 'foo', 'bar': 42} msgq.msgsnd(self.id, 0, data) self.assertEqual(msgq.msgrcv(self.id, 0), data)
def test_pass_list(self): """Pass list through queue. 1.) Send list into queue 2.) Receive from queue => Received data should equal the sent data. """ data = [1, 2, 3] msgq.msgsnd(self.id, 0, data) self.assertEqual(msgq.msgrcv(self.id, 0), data)