Ejemplo n.º 1
0
 def test_sanitize(self):
     q = AudioFile(quux)
     b = AudioFile(bar_1_1)
     q.sanitize()
     b.pop("~filename")
     self.failUnlessRaises(ValueError, b.sanitize)
     n = AudioFile({"artist": u"foo\0bar", "title": u"baz\0", "~filename": "whatever"})
     n.sanitize()
     self.failUnlessEqual(n["artist"], "foo\nbar")
     self.failUnlessEqual(n["title"], "baz")
Ejemplo n.º 2
0
 def test_sanitize(self):
     q = AudioFile(quux)
     b = AudioFile(bar_1_1)
     q.sanitize()
     b.pop('~filename')
     self.failUnlessRaises(ValueError, b.sanitize)
     n = AudioFile({
         "artist": u"foo\0bar",
         "title": u"baz\0",
         "~filename": fsnative(u"whatever")
     })
     n.sanitize()
     self.failUnlessEqual(n["artist"], "foo\nbar")
     self.failUnlessEqual(n["title"], "baz")