Exemplo n.º 1
0
    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)
Exemplo n.º 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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
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)
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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)
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
    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)
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
    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)
Exemplo n.º 12
0
    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)
Exemplo n.º 13
0
    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)
Exemplo n.º 14
0
    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)
Exemplo n.º 15
0
    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)
Exemplo n.º 16
0
    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)