@@ -0,0 +1,1001 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Afrom __future__ import absolute_import%0A%0Aimport os%0Afrom os import path%0A%0Aimport mock%0Aimport pytest%0A%0Afrom wonderful_bing.wonderful_bing import WonderfulBing%0A%0A%0Adef test_picture_has_be_downloaded():%0A    with mock.patch('os.path.exists', return_value=True):%0A        with pytest.raises(SystemExit):%0A            arguments = %7B'--directory': '/not/exist', 'ENVIRONMENT': 'gnome'%7D%0A            wonderful_bing = WonderfulBing(arguments)%0A            wonderful_bing.download_picture()%0A%0A%0Adef test_download_picture():%0A    arguments = %7B'--directory': '/tmp', 'ENVIRONMENT': 'gnome'%7D%0A    wonderful_bing = WonderfulBing(arguments)%0A    check_picture(wonderful_bing.picture_path)%0A    with mock.patch('time.sleep', return_value=None):%0A        wonderful_bing.download_picture()%0A    assert path.exists(wonderful_bing.picture_path)%0A    check_picture(wonderful_bing.picture_path)%0A%0A%0Adef check_picture(picture_path):%0A    if path.exists(picture_path):%0A        os.remove(picture_path)%0A

Add test for WonderfulBing class