Example #1
0
 def __init__(self):
     self.source_client = None
     self.destination_client = None
     self.services = [{
         "name": "Google Play Music",
         "client": GoogleClient()
     }, {
         "name": "Spotify",
         "client": SpotifyClient()
     }]
Example #2
0
	def __init__(self, session, name = "Bot"):
		self.session = session
		self.name = name

		self.google = GoogleClient()

		self.commands = {
			"import": self._import,
			"help": self._help,
			"prune": self._prune,
			"welcome": self._welcome,
			"fortune": self._fortune,
			"sync": self._sync
		}
Example #3
0
    def test_google_client(self):

        # Initialize client
        from googleclient import GoogleClient
        google_client = GoogleClient()
        assert (google_client)

        # Authenticate
        assert (google_client.authenticate())

        # Search for test tracks
        track_list = [{
            "artist": "Broods",
            "track": "Bridges",
            "album": "Evergreen"
        }, {
            "artist": "Matthew Haldeman",
            "track": "PCP",
            "album": "The Matthew Haldeman Experience"
        }]
        result = google_client.search_for_tracklist(track_list)
        assert (len(result['found']) == len(result['not_found']) == 1)

        # Create a test playlist
        playlist_name = "Test Playlist"
        playlist_id = google_client.create_playlist(
            playlist_name=playlist_name)

        # Add test tracks
        track_list = [
            "Trt4j3fkj3rqytzh3ppwm2rqnni", "Tlbdefxc2ba7cbj6g7olhvqtaay"
        ]
        result = google_client.add_tracks_to_playlist(playlist_id=playlist_id,
                                                      track_list=track_list)
        # TODO Check to make sure the tracks were added
        assert (len(result) == len(track_list) == 2)

        # Delete test playlist
        result = google_client._delete_playlist(playlist_id)
        assert (result)