def test_normal_play_song():
    file_path = get_file_path("play_list/normal_play_song")
    sid = "1699763"  # 没收
    type = "e"
    channel = "4221247"  # 缘系MHZ
    play_list = get_play_list(sid, type, channel)
    write_to_file(file_path, play_list)


# if __name__ == "__main__":
#     nose.runmodule()
Exemple #2
0
def test_programmes_collect():
    file_path = get_file_path("programmes_collect")
    programmes_collect = client.fm.programmes_collect()
    write_to_file(file_path, programmes_collect)
Exemple #3
0
def test_channels_collect():
    file_path = get_file_path("channels_collect")
    channels_collect = client.fm.channels_collect()
    write_to_file(file_path, channels_collect)
Exemple #4
0
def test_channels():
    file_path = get_file_path("channels")
    channels = client.fm.channels()
    write_to_file(file_path, channels)
#!/usr/bin/python
from test import write_to_file

fileHandler = open('PFID.txt')
fileList = fileHandler.readlines()

for i in range(0, len(fileList)):
	# get the food type 
	if fileList[i].find('Food:') != -1:
		index = fileList[i].find(":")
		food_line = fileList[i]
		food_type = food_line[index+3 : len(food_line)]
		print food_type	

	# write to file system of the xml with parameters
	if fileList[i].find('image:') != -1:
		index = fileList[i].find("\\")
		img_line = fileList[i]
		img_name_with_suffix = img_line[index+9 : len(img_line)]
	  	index = img_name_with_suffix.find(".jpg")	
		img_name = img_name_with_suffix[0: index]
		print img_name
		write_to_file(img_name_with_suffix, food_type, img_name+".xml")

fileHandler.close()
Exemple #6
0
def test_search_channel():
    file_path = get_file_path("search_channel")
    query = "华语"
    search_channel = client.fm.search_channel(query=query)
    write_to_file(file_path, search_channel)
Exemple #7
0
def test_song_detail():
    file_path = get_file_path("song_detail")
    s = {"1954748": "漂洋过海来看你"}
    sid = "1954748"
    song_detail = client.fm.song_detail(sid=sid)
    write_to_file(file_path, song_detail)
Exemple #8
0
def test_user_play_record():
    file_path = get_file_path("user_play_record")
    user_play_record = client.fm.user_play_record()
    write_to_file(file_path, user_play_record)
Exemple #9
0
def test_song_lyric():
    file_path = get_file_path("song_lyric")
    sid = "1954748"
    ssid = "1c3c"
    song_lyric = client.fm.song_lyric(sid=sid, ssid=ssid)
    write_to_file(file_path, song_lyric)
Exemple #10
0
def test_user_play_record():
    file_path = get_file_path("user_play_record")
    user_play_record = client.fm.user_play_record()
    write_to_file(file_path, user_play_record)
Exemple #11
0
def test_programme_detail():
    file_path = get_file_path("programme_detail")
    pid = "1364115"  # 日本BGN
    programme_detail = client.fm.programmes_detail(pid=pid)
    write_to_file(file_path, programme_detail)
Exemple #12
0
def test_hot_and_guess_programmes():
    file_path = get_file_path("hot_and_guess_programmes")
    hot_and_guess_programmes = client.fm.hot_and_guess_programmes()
    write_to_file(file_path, hot_and_guess_programmes)
Exemple #13
0
def test_programmes_collect():
    file_path = get_file_path("programmes_collect")
    programmes_collect = client.fm.programmes_collect()
    write_to_file(file_path, programmes_collect)
Exemple #14
0
def test_channels_collect():
    file_path = get_file_path("channels_collect")
    channels_collect = client.fm.channels_collect()
    write_to_file(file_path, channels_collect)
Exemple #15
0
def test_hot_and_guess_programmes():
    file_path = get_file_path("hot_and_guess_programmes")
    hot_and_guess_programmes = client.fm.hot_and_guess_programmes()
    write_to_file(file_path, hot_and_guess_programmes)
Exemple #16
0
def test_programme_detail():
    file_path = get_file_path("programme_detail")
    pid = "1364115"  # 日本BGN
    programme_detail = client.fm.programmes_detail(pid=pid)
    write_to_file(file_path, programme_detail)
Exemple #17
0
def test_user_info():
    file_path = get_file_path("user_info")
    user_info = client.fm.user_info()
    write_to_file(file_path, user_info)
Exemple #18
0
def test_song_lyric():
    file_path = get_file_path("song_lyric")
    sid = "1954748"
    ssid = "1c3c"
    song_lyric = client.fm.song_lyric(sid=sid, ssid=ssid)
    write_to_file(file_path, song_lyric)
Exemple #19
0
def test_song_detail():
    file_path = get_file_path("song_detail")
    s = {"1954748": "漂洋过海来看你"}
    sid = "1954748"
    song_detail = client.fm.song_detail(sid=sid)
    write_to_file(file_path, song_detail)
Exemple #20
0
def test_user_info():
    file_path = get_file_path("user_info")
    user_info = client.fm.user_info()
    write_to_file(file_path, user_info)
Exemple #21
0
def test_search_channel():
    file_path = get_file_path("search_channel")
    query = "华语"
    search_channel = client.fm.search_channel(query=query)
    write_to_file(file_path, search_channel)
Exemple #22
0
def test_search_programme():
    file_path = get_file_path("search_programme")
    query = "华语"
    search_programme = client.fm.search_programme(query=query)
    write_to_file(file_path, search_programme)
Exemple #23
0
def test_search_programme():
    file_path = get_file_path("search_programme")
    query = "华语"
    search_programme = client.fm.search_programme(query=query)
    write_to_file(file_path, search_programme)
Exemple #24
0
#!/usr/bin/python
from test import write_to_file

fileHandler = open('PFID.txt')
fileList = fileHandler.readlines()

for i in range(0, len(fileList)):
    # get the food type
    if fileList[i].find('Food:') != -1:
        index = fileList[i].find(":")
        food_line = fileList[i]
        food_type = food_line[index + 3:len(food_line)]
        print food_type

    # write to file system of the xml with parameters
    if fileList[i].find('image:') != -1:
        index = fileList[i].find("\\")
        img_line = fileList[i]
        img_name_with_suffix = img_line[index + 9:len(img_line)]
        index = img_name_with_suffix.find(".jpg")
        img_name = img_name_with_suffix[0:index]
        print img_name
        write_to_file(img_name_with_suffix, food_type, img_name + ".xml")

fileHandler.close()
Exemple #25
0
def test_channels():
    file_path = get_file_path("channels")
    channels = client.fm.channels()
    write_to_file(file_path, channels)