~ubuntu-branches/ubuntu/precise/gst0.10-python/precise

« back to all changes in this revision

Viewing changes to testsuite/test_caps.py

Tags: upstream-0.10.8
Import upstream version 0.10.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
class CapsTest(TestCase):
27
27
    def setUp(self):
28
28
        TestCase.setUp(self)
29
 
        self.caps = gst.caps_from_string('video/x-raw-yuv,width=10,framerate=5.0;video/x-raw-rgb,width=15,framerate=10.0')
 
29
        self.caps = gst.caps_from_string('video/x-raw-yuv,width=10,framerate=5/1;video/x-raw-rgb,width=15,framerate=10/1')
30
30
        self.assertEquals(self.caps.__refcount__, 1)
31
31
        self.structure = self.caps[0]
32
32
        self.any = gst.Caps("ANY")
47
47
        mime = structure.get_name()
48
48
        assert mime == 'video/x-raw-rgb'
49
49
 
 
50
    def testCapsContainingMiniObjects(self):
 
51
        # buffer contains hex encoding of ascii 'abcd'
 
52
        caps = gst.Caps("video/x-raw-yuv, buf=(buffer)61626364")
 
53
        buf = caps[0]['buf']
 
54
        assert isinstance(buf, gst.Buffer)
 
55
        assert buf.data == "abcd"
 
56
 
 
57
        buf = gst.Buffer("1234")
 
58
        caps[0]['buf2'] = buf
 
59
        buf2 = caps[0]['buf2']
 
60
        assert buf2 == buf
 
61
 
50
62
    def testCapsConstructEmpty(self):
51
63
        caps = gst.Caps()
52
64
        assert isinstance(caps, gst.Caps)
90
102
        assert isinstance(struct['height'], float)
91
103
        assert struct['height'] == 20.0
92
104
 
93
 
    def testCapsRefernceStructs(self):
 
105
    def testCapsReferenceStructs(self):
94
106
        'test that shows why it\'s not a good idea to use structures by reference'
95
107
        caps = gst.Caps('hi/mom,width=0')
96
108
        structure = caps[0]