def search(): """ #gets variables for the UI of the search queries """ artist_name = ui.get_string('What is the name of the artist you are searching for?: ') album_title = ui.get_string('What is the name of the album you are looking for?: ') song_title = ui.get_string('What is the name of the song you are looking for?: ') follower_count = search_spotify(artist_name) lyrics = search_lyrics(artist_name, song_title) artwork = search_artwork(artist_name, album_title) results = { 'artist_name': artist_name, 'album_title': album_title, 'song_title': song_title, 'artwork': artwork, 'lyrics': lyrics, 'follower_count': follower_count } print_search_results(results) save = ui.save_bookmark() if save == True: save_new_bookmark(results) else: print('Okay this bookmark will not be saved')
def delete_tree(): name = ui.get_string('Enter name of tree') deleted = database.delete_tree_by_name(name) if deleted: print('Tree was deleted') else: print('That tree was not in the database')
def add_tree(): name = ui.get_string('Enter name of tree') max_height = ui.get_positive_float(f'Enter max height of {name}') try: database.add_tree(name, max_height) print('Added tree') except TreeError as e: print(e)
def get_name_and_email(): name = ui.get_string('Enter artist name: ') email = ui.get_string('Enter artist email: ') return name, email
def test_get_string_rejects_empty_inputs(self, mock_input): question = "Please enter a name:" self.assertEqual('some name', ui.get_string(question))
def get_artwork_name(): return ui.get_string('Enter artwork name: ')
def get_artwork_price(): return ui.get_string('Enter price: ')
def test_get_string(self, mock): message = 'message' response = ui.get_string(message) self.assertTrue(response, 'fake_response')