def test_process_file_with_filename_date(mocker):
    shutil.rmtree('output', ignore_errors=True)
    mocker.patch.object(Phockup, 'check_directories')
    mocker.patch.object(Phockup, 'walk_directory')
    mocker.patch.object(Exif, 'data')
    Exif.data.return_value = {'MIMEType': 'image/jpeg'}
    Phockup('input', 'output').process_file('input/date_20170101_010101.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    shutil.rmtree('output', ignore_errors=True)
def test_process_file_with_filename_date(mocker):
    shutil.rmtree('output', ignore_errors=True)
    mocker.patch.object(Phockup, 'check_directories')
    mocker.patch.object(Phockup, 'walk_directory')
    mocker.patch.object(Exif, 'data')
    Exif.data.return_value = {'MIMEType': 'image/jpeg'}
    Phockup('input', 'output').process_file('input/date_20170101_010101.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    shutil.rmtree('output', ignore_errors=True)