Travis Shirk avatar Travis Shirk committed af0993c

Tests etc.

Comments (0)

Files changed (4)

     paverutils = None
 
 PROJECT = u"eyeD3"
-VERSION = "0.7.0-rc2"
+VERSION = "0.7.0-rc3"
 
-LICENSE = open("COPYING", "r").read().strip('\n')
+LICENSE     = open("COPYING", "r").read().strip('\n')
 DESCRIPTION = "Audio data toolkit (ID3 and MP3)"
 LONG_DESCRIPTION = """
 eyeD3 is a Python module and command line program for processing ID3 tags.
 play time, etc.) is also provided. The formats supported are ID3
 v1.0/v1.1 and v2.3/v2.4.
 """
-URL = "http://eyeD3.nicfit.net"
-AUTHOR = "Travis Shirk"
+URL          = "http://eyeD3.nicfit.net"
+AUTHOR       = "Travis Shirk"
 AUTHOR_EMAIL = "travis@pobox.com"
 SRC_DIST_TGZ = "%s-%s.tgz" % (PROJECT, VERSION)
 SRC_DIST_ZIP = "%s.zip" % os.path.splitext(SRC_DIST_TGZ)[0]
-DOC_DIST = "%s_docs-%s.tgz" % (PROJECT, VERSION)
-MD5_DIST = "%s.md5" % os.path.splitext(SRC_DIST_TGZ)[0]
-DOC_BUILD_D = "docs/_build"
+DOC_DIST     = "%s_docs-%s.tgz" % (PROJECT, VERSION)
+MD5_DIST     = "%s.md5" % os.path.splitext(SRC_DIST_TGZ)[0]
+DOC_BUILD_D  = "docs/_build"
 
 PACKAGE_DATA = paver.setuputils.find_package_data("src/eyed3",
                                                   package="eyed3",
 
 
 @task
-@needs("distclean", "sdist", "test_dist", "docdist", "changelog")
+@needs("changelog",
+       "distclean",
+       "sdist", "test_dist", "docdist")
 def release():
     checklist()
 
 Release Procedure
 =================
 
+# Build
 - hg up stable
 - paver test
 - clean working copy / use sandbox
 - paver release
 - hg tag v%(VERSION)s
 - hg commit -m 'prep for release'
+- hg nudge
 
-# Merge to default
-- hg up default
-- hg merge stable
-
+# Publish
 - Update eyeD3.nicfit.net
   fab -H melvins.nicfit.net:222 deploy
 - Announce to mailing list
 - Announce to FreshMeat
 - Upload to Python Index (paver upload?)
 
+# Merge to default
+- hg up default
+- hg merge stable
+
 - ebuild
 """ % globals())
 
+@task
+def release2():
+    # Ensure we're on stable branch
+    sh("test $(hg branch) = 'stable'")
+
 def cog_pluginHelp(name):
     from string import Template
     import argparse

src/eyed3/plugins/classic.py

         def UnicodeArg(arg):
             return unicode(arg, LOCAL_ENCODING)
         def PositiveIntArg(i):
-            if i in (None, ''):
-                return None
             i = int(i)
             if i < 0:
                 raise ValueError("positive number required")

src/test/id3/test_frames.py

         # Comparison is on each member, not reference ID
         assert_equal(df.date, dt)
 
+    # Invalid dates
+    for d in [b"1234:12"]:
+        date = DateFrame("TDRL")
+        date.date = d
+        assert_false(date.date)
 
+        try:
+            date.date = 9
+        except TypeError:
+            pass
+        else:
+            assert_false("TypeError not thrown")
+
+
+
+def test_compression():
+    data = open(__file__).read()
+    compressed = Frame.compress(data)
+    assert_equal(data, Frame.decompress(compressed))
+
+def test_encryption():
+    assert_raises(NotImplementedError, Frame.encrypt, "Iceburn")
+    assert_raises(NotImplementedError, Frame.decrypt, "Iceburn")
+

src/test/test_classic_plugin.py

             assert_is_not_none(af.tag)
             assert_equal(af.tag.track_num[0], 14)
 
+    def testNewTagTrackNumInvalid(self):
+        for opts in [ ["-n", "abc", self.test_file],
+                      ["--track=-14", self.test_file]
+                      ]:
+
+            with RedirectStdStreams() as out:
+                try:
+                    args, _, config = main.parseCommandLine(opts)
+                except SystemExit as ex:
+                    assert_not_equal(ex.code, 0)
+                else:
+                    assert_false("Should not have gotten here")
+
     def testNewTagTrackTotal(self, version=id3.ID3_DEFAULT_VERSION):
         if version[0] == 1:
             # No support for this in v1.x
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.