Skip to content

Commit e6a4964

Browse files
author
Jan Sebastian Rothe
committed
pre-commit changes
1 parent b88dae3 commit e6a4964

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/fagfunksjoner/paths/versions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,17 +235,21 @@ def latest_version_path(filepath: str) -> str:
235235
if files:
236236
# Get the latest file version based on the available files.
237237
latest_files = get_latest_fileversions(files)[-1]
238-
238+
239239
# Check if the result is a list, and get the last item if so
240240
if isinstance(latest_files, list):
241241
if latest_files and isinstance(latest_files[-1], str):
242242
latest_file = latest_files[-1]
243243
else:
244-
raise ValueError(f"Expected latest_files to contain strings, got {latest_files}")
244+
raise ValueError(
245+
f"Expected latest_files to contain strings, got {latest_files}"
246+
)
245247
elif isinstance(latest_files, str):
246248
latest_file = latest_files
247249
else:
248-
raise ValueError(f"Expected a list of strings or a single string, got {type(latest_files)}: {latest_files}")
250+
raise ValueError(
251+
f"Expected a list of strings or a single string, got {type(latest_files)}: {latest_files}"
252+
)
249253

250254
# Extract the version number from the latest file.
251255
latest_version_number = get_version_number(latest_file)

tests/paths/test_versions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_latest_version_number(mock_latest_version_path, mock_get_fileversions):
4646
assert latest_version_number(filepath_local) == 2
4747
assert latest_version_path(filepath_local) == "/local/folder/file_v2.parquet"
4848

49+
4950
# Test for next_version_number function
5051
@patch("fagfunksjoner.paths.versions.get_fileversions")
5152
@patch("fagfunksjoner.paths.versions.latest_version_path")
@@ -56,7 +57,6 @@ def test_next_version_number(mock_get_fileversions, mock_latest_version_path):
5657
assert next_version_number(filepath_gs) == 3
5758

5859

59-
6060
# Test for next_version_path function
6161
@patch("fagfunksjoner.paths.versions.latest_version_path")
6262
@patch("fagfunksjoner.paths.versions.next_version_number")

0 commit comments

Comments
 (0)