diff options
| author | tmzullinger <tmzullinger@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2008-08-23 18:02:42 +0000 |
|---|---|---|
| committer | tmzullinger <tmzullinger@f01d2545-417e-4e96-918e-98f8d0dbbcb6> | 2008-08-23 18:02:42 +0000 |
| commit | 21f833e2ffc6e031d5d3421e9dabf38069cf4896 (patch) | |
| tree | 4ad21c366991b8341a48287741917ec38f7d24d6 /bindings/python/tests/tests.py | |
| parent | 9a98fc1a1b4476dd57e226cfafaa283997732752 (diff) | |
| download | libgpod-21f833e2ffc6e031d5d3421e9dabf38069cf4896.tar.gz libgpod-21f833e2ffc6e031d5d3421e9dabf38069cf4896.tar.xz libgpod-21f833e2ffc6e031d5d3421e9dabf38069cf4896.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/tests.py')
| -rw-r--r-- | bindings/python/tests/tests.py | 12 |
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() |
