예제 #1
0
def test_get_image_full_path():
    test_file = Path('./test.png')
    test_file.touch()
    ctx = Context()
    ctx.media_folders = [Path('.')]
    ctx.image_current = test_file.name
    assert image._get_image_full_path(ctx) == str(test_file.absolute())
예제 #2
0
def test_image_doesnt_exist():
    ctx = Context()
    ctx.media_folders = [Path('.')]
    ctx.image_current = Path('./nope').name
    with pytest.raises(FileNotFoundError):
        image._get_image_full_path(ctx)