2
# vi:si:et:sw=4:sts=4:ts=4
4
# gst-python - Python bindings for GStreamer
5
# Copyright (C) 2007 Johan Dahlin
7
# This library is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU Lesser General Public
9
# License as published by the Free Software Foundation; either
10
# version 2.1 of the License, or (at your option) any later version.
12
# This library is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
# Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public
18
# License along with this library; if not, write to the Free Software
19
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
from common import gst, TestCase
24
class TestTagList(TestCase):
25
def testContains(self):
26
taglist = gst.TagList()
27
self.failIf('key' in taglist)
28
taglist['key'] = 'value'
29
self.failUnless('key' in taglist)
32
taglist = gst.TagList()
33
self.assertEqual(len(taglist), 0)
34
taglist['key1'] = 'value'
35
taglist['key2'] = 'value'
36
self.assertEqual(len(taglist), 2)
39
taglist = gst.TagList()
40
self.assertEqual(taglist.keys(), [])
41
taglist['key1'] = 'value'
42
taglist['key2'] = 'value'
45
self.assertEqual(keys, ['key1', 'key2'])