Esempio n. 1
0
def test_user_file_thumbnail_path(data_fixture):
    handler = UserFileHandler()
    assert handler.user_file_thumbnail_path(
        'test.jpg', 'tiny') == 'thumbnails/tiny/test.jpg'
    assert handler.user_file_thumbnail_path(
        'another_file.png', 'small') == 'thumbnails/small/another_file.png'

    user_file = data_fixture.create_user_file()
    assert handler.user_file_thumbnail_path(
        user_file, 'tiny') == f'thumbnails/tiny/{user_file.name}'
Esempio n. 2
0
def test_user_file_thumbnail_path(data_fixture):
    handler = UserFileHandler()
    assert (
        handler.user_file_thumbnail_path("test.jpg", "tiny")
        == "thumbnails/tiny/test.jpg"
    )
    assert (
        handler.user_file_thumbnail_path("another_file.png", "small")
        == "thumbnails/small/another_file.png"
    )

    user_file = data_fixture.create_user_file()
    assert (
        handler.user_file_thumbnail_path(user_file, "tiny")
        == f"thumbnails/tiny/{user_file.name}"
    )