tests: Use read_test_image_file helper.

This commit is contained in:
Steve Howell
2021-12-12 16:17:33 +00:00
committed by Tim Abbott
parent 186c446458
commit 53ffb8152f
2 changed files with 9 additions and 6 deletions

View File

@@ -205,6 +205,11 @@ def get_test_image_file(filename: str) -> IO[bytes]:
return open(os.path.join(test_avatar_dir, filename), "rb")
def read_test_image_file(filename: str) -> bytes:
with get_test_image_file(filename) as img_file:
return img_file.read()
def avatar_disk_path(
user_profile: UserProfile, medium: bool = False, original: bool = False
) -> str: