コード例 #1
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #2
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #3
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #4
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #5
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #6
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #7
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #8
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #9
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #10
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #11
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #12
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #13
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #14
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)
コード例 #15
0
ファイル: test_msgq.py プロジェクト: sral/msgq
    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)