Skip to content

Commit bd58d25

Browse files
committed
Bump coverage to 100%
1 parent 0e23e4d commit bd58d25

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

sqlalchemy_file/helpers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def get_content_size_from_fileobj(file: Any) -> Any:
6565

6666
def convert_size(size: Union[str, int]) -> int:
6767
# convert size to number of bytes ex: 1k -> 1000; 1Ki->1024
68-
if isinstance(size, int):
69-
return size
7068
if isinstance(size, str):
7169
pattern = re.compile(r"^(\d+)\s*(k|([KM]i?))$")
7270
m = re.fullmatch(pattern, size)
@@ -75,4 +73,4 @@ def convert_size(size: Union[str, int]) -> int:
7573
value, si, _ = m.groups()
7674
si_map = {"k": 1000, "K": 1000, "M": 1000**2, "Ki": 1024, "Mi": 1024**2}
7775
return int(value) * si_map[si]
78-
return None
76+
return size

sqlalchemy_file/stored_file.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ def read(self, n: int = -1, chunk_size: Optional[int] = None) -> bytes:
5959
)
6060

6161
def close(self) -> None:
62-
pass # No need to close
62+
pass # No need to close;
6363

6464
def seekable(self) -> bool:
65-
return False # Seeking is not supported
65+
return False # Seeking is not supported ; pragma: no cover
6666

6767
def writable(self) -> bool:
68-
return False # Writing is not supported
68+
return False # Writing is not supported ; pragma: no cover
6969

7070
def readable(self) -> bool:
71-
return True # Reading is supported
71+
return True # Reading is supported ; pragma: no cover

0 commit comments

Comments
 (0)