示例#1
0
def test_img_downloader_invalid_urls():
    print("test_img_downloader_invalid_urls():")

    urls = get_invalid_urls()
    folder_path = get_path_to_folder_for_images()
    image_downloader.img_downloader(urls, folder_path)

    files = os.listdir(folder_path)
    remove_folder(folder_path)
    if len(files) != 0:
        raise Exception("Fail. Image downloaded by invalid link")
示例#2
0
def test_img_downloader_valid_urls():
    print("test_img_downloader_valid_urls():")

    urls = get_test_urls()
    folder_path = get_path_to_folder_for_images()
    image_downloader.img_downloader(urls, folder_path)

    files = os.listdir(folder_path)
    remove_folder(folder_path)
    if len(files) != len(urls):
        raise Exception("Fail. Not all images was downloaded")