We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 314a72a commit 1096899Copy full SHA for 1096899
1 file changed
tests/conftest.py
@@ -48,9 +48,10 @@ def get_random_string(length: int = 36) -> str:
48
result_str = "".join(random.choice(letters) for _ in range(length))
49
return result_str
50
51
- def read_image(self) -> bytes:
52
- with open(self.image_captcha_path_example, "rb") as img_file:
+ @staticmethod
+ def read_image(file_path: str = image_captcha_path_example) -> bytes:
53
+ with open(file_path, "rb") as img_file:
54
return img_file.read()
55
- def read_image_as_str(self) -> str:
56
- return base64.b64encode(self.read_image()).decode("utf-8")
+ 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