[SCM] morituri/master: * morituri/test/test_image_image.py (added): Add tests for AudioRip CRC'ing images.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:08:44 UTC 2014


The following commit has been merged in the master branch:
commit a696b14ffe87a46ec88ac63502735d9aac935514
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat Apr 11 22:08:29 2009 +0000

    	* morituri/test/test_image_image.py (added):
    	  Add tests for AudioRip CRC'ing images.

diff --git a/ChangeLog b/ChangeLog
index 3239514..f532ecb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-12  Thomas Vander Stichele  <thomas at apestaart dot org>
+
+	* morituri/test/test_image_image.py (added):
+	  Add tests for AudioRip CRC'ing images.
+
 2009-04-11  Thomas Vander Stichele  <thomas at apestaart dot org>
 
 	* morituri/test/track-separate.cue (added):
diff --git a/morituri/test/test_image_image.py b/morituri/test/test_image_image.py
new file mode 100644
index 0000000..112b8b5
--- /dev/null
+++ b/morituri/test/test_image_image.py
@@ -0,0 +1,48 @@
+# -*- Mode: Python; test-case-name: morituri.test.test_image_cue -*-
+# vi:si:et:sw=4:sts=4:ts=4
+
+import os
+import unittest
+
+import gobject
+gobject.threads_init()
+
+from morituri.image import image
+from morituri.common import task
+
+def h(i):
+    return "0x%08x" % i
+
+class TrackSingleTestCase(unittest.TestCase):
+    def setUp(self):
+        self.image = image.Image(os.path.join(os.path.dirname(__file__),
+            'track-single.cue'))
+
+    def testAudioRipCRC(self):
+        crctask = image.AudioRipCRCTask(self.image) 
+        runner = task.SyncRunner()
+        runner.run(crctask, verbose=False)
+
+        self.assertEquals(len(crctask.crcs), 4)
+        self.assertEquals(h(crctask.crcs[0]), '0x00000000')
+        self.assertEquals(h(crctask.crcs[1]), '0x793fa868')
+        self.assertEquals(h(crctask.crcs[2]), '0x8dd37c26')
+        self.assertEquals(h(crctask.crcs[3]), '0x00000000')
+
+class KingsSeparateTestCase(unittest.TestCase):
+    def setUp(self):
+        self.image = image.Image(os.path.join(os.path.dirname(__file__),
+            'track-separate.cue'))
+
+    def testAudioRipCRC(self):
+        crctask = image.AudioRipCRCTask(self.image) 
+        runner = task.SyncRunner()
+        runner.run(crctask, verbose=False)
+
+        self.assertEquals(len(crctask.crcs), 4)
+        self.assertEquals(h(crctask.crcs[0]), '0xaf18681e')
+        self.assertEquals(h(crctask.crcs[1]), '0xd63dc2d2')
+        self.assertEquals(h(crctask.crcs[2]), '0xd63dc2d2')
+        self.assertEquals(h(crctask.crcs[3]), '0x7271db39')
+
+

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list