Example #1
0
 def test_unfavoriting(self):
     cl = self.client
     song = SoundcloudFile("http://uri", TRACK_ID, True, cl)
     self.failUnless(song.has_rating)
     self.failUnlessEqual(song("~#rating"), 1.0)
     song['~#rating'] = 0.2
     song.write()
     self.failIf(song.favorite)
     self.failUnlessEqual(cl.unfavoritings[TRACK_ID], 1)
     self.failUnlessEqual(cl.favoritings[TRACK_ID], 0)
     song.write()
     self.failUnlessEqual(cl.unfavoritings[TRACK_ID], 1)
 def test_unfavoriting(self):
     cl = self.client
     song = SoundcloudFile("http://uri", TRACK_ID, True, cl)
     self.failUnless(song.has_rating)
     self.failUnlessEqual(song("~#rating"), 1.0)
     song['~#rating'] = 0.2
     song.write()
     self.failIf(song.favorite)
     self.failUnlessEqual(cl.unfavoritings[TRACK_ID], 1)
     self.failUnlessEqual(cl.favoritings[TRACK_ID], 0)
     song.write()
     self.failUnlessEqual(cl.unfavoritings[TRACK_ID], 1)
Example #3
0
 def test_favoriting(self):
     client = self.client
     song = SoundcloudFile("http://uri", TRACK_ID, client, favorite=False)
     self.failIf(song.has_rating)
     song['~#rating'] = 1.0
     self.failUnless(song.has_rating)
     self.failUnlessEqual(song("~#rating"), 1.0)
     song.write()
     self.failUnless(song.favorite)
     self.failUnlessEqual(client.favoritings[TRACK_ID], 1)
     self.failUnlessEqual(client.unfavoritings[TRACK_ID], 0)
     song.write()
     self.failUnlessEqual(client.favoritings[TRACK_ID], 1)