Skip to content

Commit 1096899

Browse files
committed
Update conftest.py
1 parent 314a72a commit 1096899

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ def get_random_string(length: int = 36) -> str:
4848
result_str = "".join(random.choice(letters) for _ in range(length))
4949
return result_str
5050

51-
def read_image(self) -> bytes:
52-
with open(self.image_captcha_path_example, "rb") as img_file:
51+
@staticmethod
52+
def read_image(file_path: str = image_captcha_path_example) -> bytes:
53+
with open(file_path, "rb") as img_file:
5354
return img_file.read()
5455

55-
def read_image_as_str(self) -> str:
56-
return base64.b64encode(self.read_image()).decode("utf-8")
56+
def read_image_as_str(self, file_path: str = image_captcha_path_example) -> str:
57+
return base64.b64encode(self.read_image(file_path=file_path)).decode("utf-8")

0 commit comments

Comments
 (0)