示例#1
0
 def test_add(self):
     song = AudioFile()
     self.failIf("foo" in song)
     song.add("foo", "bar")
     self.failUnlessEqual(song["foo"], "bar")
     song.add("foo", "another")
     self.failUnlessEqual(song.list("foo"), ["bar", "another"])
 def test_add(self):
     song = AudioFile()
     self.failIf("foo" in song)
     song.add("foo", "bar")
     self.failUnlessEqual(song["foo"], "bar")
     song.add("foo", "another")
     self.failUnlessEqual(song.list("foo"), ["bar", "another"])
 def test_change(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.change("foo", "bar", "one more")
     self.failUnlessEqual(song.list("foo"), ["one more", "another"])
     song.change("foo", "does not exist", "finally")
     self.failUnlessEqual(song["foo"], "finally")
     song.change("foo", "finally", "we're done")
     self.failUnlessEqual(song["foo"], "we're done")
示例#4
0
 def test_change(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.change("foo", "bar", "one more")
     self.failUnlessEqual(song.list("foo"), ["one more", "another"])
     song.change("foo", "does not exist", "finally")
     self.failUnlessEqual(song["foo"], "finally")
     song.change("foo", "finally", "we're done")
     self.failUnlessEqual(song["foo"], "we're done")
 def test_remove_all(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.add("foo", "one more")
     song.remove("foo")
     self.assertFalse("foo" in song)
示例#6
0
 def test_remove_all(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.add("foo", "one more")
     song.remove("foo")
     self.assertFalse("foo" in song)
 def test_remove(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.add("foo", "one more")
     song.remove("foo", "another")
     self.failUnlessEqual(song.list("foo"), ["bar", "one more"])
     song.remove("foo", "bar")
     self.failUnlessEqual(song.list("foo"), ["one more"])
     song.remove("foo", "one more")
     self.failIf("foo" in song)
示例#8
0
 def test_remove(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.add("foo", "another")
     song.add("foo", "one more")
     song.remove("foo", "another")
     self.failUnlessEqual(song.list("foo"), ["bar", "one more"])
     song.remove("foo", "bar")
     self.failUnlessEqual(song.list("foo"), ["one more"])
     song.remove("foo", "one more")
     self.failIf("foo" in song)
 def test_remove_empty(self):
     song = AudioFile()
     song.add("foo", u"")
     song.remove("foo", u"")
     self.assertFalse("foo" in song)
 def test_remove_unknown(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.remove("foo", "not in list")
     song.remove("nope")
     self.failUnlessEqual(song.list("foo"), ["bar"])
示例#11
0
 def test_remove_empty(self):
     song = AudioFile()
     song.add("foo", u"")
     song.remove("foo", u"")
     self.assertFalse("foo" in song)
示例#12
0
 def test_remove_unknown(self):
     song = AudioFile()
     song.add("foo", "bar")
     song.remove("foo", "not in list")
     song.remove("nope")
     self.failUnlessEqual(song.list("foo"), ["bar"])