Esempio n. 1
0
 def setUp(self):
     self.spotify = Spotify()
Esempio n. 2
0
class SpotifyTests(unittest.TestCase):
    
    def setUp(self):
        self.spotify = Spotify()
    
    def tearDown(self):
        self.spotify.pause()
        time.sleep(0.5)
    
    def test_play_without_uri(self):
        self.spotify.play()
        self.assertTrue(self.spotify._get_playing_state())
    
    def test_play_with_uri(self):
        uri = "spotify:track:1vWGa8yC21ZELs9dAhiC2Q"
        self.spotify.play(uri)
        self.assertEqual(uri, self.spotify._get_uri_playing())
    
    def test_pause(self):
        uri = "spotify:track:1vWGa8yC21ZELs9dAhiC2Q"
        self.spotify.play(uri)
        self.spotify.pause()
        self.assertFalse(self.spotify._get_playing_state())