Beispiel #1
0
    def test_daap_object_decode(self):
        """
        Test decode DAAPObject.
        """

        daap_object = DAAPObject()

        daap_object.decode(
            cStringIO.StringIO("mstt\x00\x00\x00\x04\x00\x00\x00\xc8"))

        self.assertEqual(daap_object.code, "mstt")
        self.assertEqual(daap_object.value, 200)
    def test_daap_object_decode(self):
        """
        Test decode DAAPObject.
        """

        daap_object = DAAPObject()

        daap_object.decode(
            cStringIO.StringIO("mstt\x00\x00\x00\x04\x00\x00\x00\xc8"))

        self.assertEqual(daap_object.code, "mstt")
        self.assertEqual(daap_object.value, 200)
    def test_daap_object_encode(self):
        """
        Test encode DAAPObject.
        """

        daap_object = DAAPObject("dmap.status", 200)

        self.assertEqual(daap_object.code, "mstt")
        self.assertEqual(daap_object.value, 200)

        self.assertEqual(daap_object.encode(),
                         "mstt\x00\x00\x00\x04\x00\x00\x00\xc8")
Beispiel #4
0
    def test_daap_object_encode(self):
        """
        Test encode DAAPObject.
        """

        daap_object = DAAPObject("dmap.status", 200)

        self.assertEqual(daap_object.code, "mstt")
        self.assertEqual(daap_object.value, 200)

        self.assertEqual(
            daap_object.encode(),
            "mstt\x00\x00\x00\x04\x00\x00\x00\xc8")