summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2008-08-23 18:02:42 +0000
committerTodd Zullinger <tmz@pobox.com>2008-08-23 18:02:42 +0000
commitf57f0b7be3f082d8b351236c018020f5f8d70b31 (patch)
tree4ad21c366991b8341a48287741917ec38f7d24d6 /bindings/python/tests
parent27e708ef6565c6f5427a00e39e90f7e59aba2a3e (diff)
downloadlibgpod-f57f0b7be3f082d8b351236c018020f5f8d70b31.tar.gz
libgpod-f57f0b7be3f082d8b351236c018020f5f8d70b31.tar.xz
libgpod-f57f0b7be3f082d8b351236c018020f5f8d70b31.zip
Python: Be more consistent with other container objects and classes
This enables testing whether a key exists in an object (e.g. "'title' in track") as well as iterating over a Track or Photo object's keys, values, or items. The items() and pairs() methods were renamed to values() and items(), respectively, in the Track and Photo classes. git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@2110 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings/python/tests')
-rw-r--r--bindings/python/tests/tests.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/bindings/python/tests/tests.py b/bindings/python/tests/tests.py
index 657e7f5..6ebb8ff 100644
--- a/bindings/python/tests/tests.py
+++ b/bindings/python/tests/tests.py
@@ -79,7 +79,12 @@ class TestiPodFunctions(unittest.TestCase):
t['time_added'] = time.mktime(date.timetuple())
self.assertEqual(date.year, t['time_added'].year)
self.assertEqual(date.second, t['time_added'].second)
-
+
+ def testTrackContainerMethods(self):
+ self.testAddTrack()
+ track = self.db[0]
+ self.failUnless('title' in track)
+
def testVersion(self):
self.assertEqual(type(gpod.version_info),
types.TupleType)
@@ -182,5 +187,10 @@ class TestPhotoDatabase(unittest.TestCase):
for album in self.db.PhotoAlbums:
[photo for photo in album]
+ def testPhotoContainerMethods(self):
+ self.testAddPhoto()
+ photo = self.db[0]
+ self.failUnless('id' in photo)
+
if __name__ == '__main__':
unittest.main()