Ticket #2: pyogg-ticket2-test.patch

Index: ogg/test/common.py
===================================================================
--- ogg/test/common.py	(revision 20)
+++ ogg/test/common.py	(working copy)
@@ -9,8 +9,13 @@
                     ],
     }
 
+SAMPLE_FILE = 'song30.ogg'
+
 def sibling(name, reference = __file__):
     return os.path.join(os.path.dirname(reference), name)
 
-def readSampleFile(filename='song30.ogg'):
-    return file(sibling(filename), 'rb').read()
+def getSampleFilename(filename=SAMPLE_FILE):
+    return sibling(filename)
+
+def readSampleFile(filename=SAMPLE_FILE):
+    return file(getSampleFilename(filename), 'rb').read()
Index: ogg/test/test_legacy.py
===================================================================
--- ogg/test/test_legacy.py	(revision 0)
+++ ogg/test/test_legacy.py	(revision 0)
@@ -0,0 +1,12 @@
+# Unit tests for the "legacy" pyogg/pyvorbis APIs
+
+import unittest
+from ogg import _vorbis
+from ogg.test import common
+
+class TestLegacy(unittest.TestCase):
+
+    def test_VorbisFile(self):
+        vf = _vorbis.VorbisFile(common.getSampleFilename())
+        vf.close()
+

Property changes on: ogg/test/test_legacy.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native