def test_process_move(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 = Phockup('input', 'output', move=True)
    open('input/tmp_20170101_010101.jpg', 'w').close()
    open('input/tmp_20170101_010101.xmp', 'w').close()
    phockup.process_file('input/tmp_20170101_010101.jpg')
    phockup.process_file('input/tmp_20170101_010101.xmp')
    assert (not os.path.isfile('input/tmp_20170101_010101.jpg'))
    assert (not os.path.isfile('input/tmp_20170101_010101.xmp'))
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.xmp')
    shutil.rmtree('output', ignore_errors=True)
def test_process_move(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 = Phockup('input', 'output', move=True)
    open('input/tmp_20170101_010101.jpg', 'w').close()
    open('input/tmp_20170101_010101.xmp', 'w').close()
    phockup.process_file('input/tmp_20170101_010101.jpg')
    phockup.process_file('input/tmp_20170101_010101.xmp')
    assert (not os.path.isfile('input/tmp_20170101_010101.jpg'))
    assert (not os.path.isfile('input/tmp_20170101_010101.xmp'))
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.xmp')
    shutil.rmtree('output', ignore_errors=True)