def test_process_exists_same(mocker, caplog):
    shutil.rmtree('output', ignore_errors=True)
    mocker.patch.object(Phockup, 'check_directories')
    mocker.patch.object(Phockup, 'walk_directory')
    phockup = Phockup('input', 'output')
    phockup.process_file('input/exif.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    with caplog.at_level(logging.INFO):
        phockup.process_file('input/exif.jpg')
    assert ('skipped, duplicated file' in caplog.text)
    shutil.rmtree('output', ignore_errors=True)
def test_process_exists_same(mocker, caplog):
    shutil.rmtree('output', ignore_errors=True)
    mocker.patch.object(Phockup, 'check_directories')
    mocker.patch.object(Phockup, 'walk_directory')
    phockup = Phockup('input', 'output')
    phockup.process_file('input/exif.jpg')
    assert os.path.isfile('output/2017/01/01/20170101-010101.jpg')
    with caplog.at_level(logging.INFO):
        phockup.process_file('input/exif.jpg')
    assert ('skipped, duplicated file' in caplog.text)
    shutil.rmtree('output', ignore_errors=True)