Refactor test cases for improved readability and consistency
- Adjusted function signatures in various test files to enhance clarity by aligning parameters. - Updated patching syntax for better readability across test cases. - Improved formatting and spacing in test assertions and mock setups. - Ensured consistent use of async/await patterns in async test functions. - Enhanced comments for better understanding of test intentions.
This commit is contained in:
@@ -153,7 +153,10 @@ class TestSoundScannerService:
|
||||
"files": [],
|
||||
}
|
||||
await scanner_service._sync_audio_file(
|
||||
temp_path, "SDB", existing_sound, results,
|
||||
temp_path,
|
||||
"SDB",
|
||||
existing_sound,
|
||||
results,
|
||||
)
|
||||
|
||||
assert results["skipped"] == 1
|
||||
@@ -257,7 +260,10 @@ class TestSoundScannerService:
|
||||
"files": [],
|
||||
}
|
||||
await scanner_service._sync_audio_file(
|
||||
temp_path, "SDB", existing_sound, results,
|
||||
temp_path,
|
||||
"SDB",
|
||||
existing_sound,
|
||||
results,
|
||||
)
|
||||
|
||||
assert results["updated"] == 1
|
||||
@@ -296,7 +302,8 @@ class TestSoundScannerService:
|
||||
# Mock file operations
|
||||
with (
|
||||
patch(
|
||||
"app.services.sound_scanner.get_file_hash", return_value="custom_hash",
|
||||
"app.services.sound_scanner.get_file_hash",
|
||||
return_value="custom_hash",
|
||||
),
|
||||
patch("app.services.sound_scanner.get_audio_duration", return_value=60000),
|
||||
patch("app.services.sound_scanner.get_file_size", return_value=2048),
|
||||
@@ -316,7 +323,10 @@ class TestSoundScannerService:
|
||||
"files": [],
|
||||
}
|
||||
await scanner_service._sync_audio_file(
|
||||
temp_path, "CUSTOM", None, results,
|
||||
temp_path,
|
||||
"CUSTOM",
|
||||
None,
|
||||
results,
|
||||
)
|
||||
|
||||
assert results["added"] == 1
|
||||
|
||||
Reference in New Issue
Block a user