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")