chore: Add deprecation warnings and update documentation (Task 9)
Task 9: Clean up legacy code - Added deprecation warnings to Serie.save_to_file() and load_from_file() - Updated infrastructure.md with Data Storage section documenting: - SQLite database as primary storage - Legacy file storage as deprecated - Data migration process - Added deprecation warning tests for Serie class - Updated existing tests to handle new warnings - All 1012 tests pass (872 unit + 55 API + 85 integration)
This commit is contained in:
@@ -473,10 +473,19 @@ class TestSerieListDeprecationWarnings:
|
||||
warnings.simplefilter("always")
|
||||
serie_list.add(sample_serie)
|
||||
|
||||
# Check deprecation warning was raised
|
||||
assert len(w) == 1
|
||||
assert issubclass(w[0].category, DeprecationWarning)
|
||||
assert "add_to_db()" in str(w[0].message)
|
||||
# Check at least one deprecation warning was raised for add()
|
||||
# (Note: save_to_file also raises a warning, so we may get 2)
|
||||
deprecation_warnings = [
|
||||
warning for warning in w
|
||||
if issubclass(warning.category, DeprecationWarning)
|
||||
]
|
||||
assert len(deprecation_warnings) >= 1
|
||||
# Check that one of them is from add()
|
||||
add_warnings = [
|
||||
warning for warning in deprecation_warnings
|
||||
if "add_to_db()" in str(warning.message)
|
||||
]
|
||||
assert len(add_warnings) == 1
|
||||
|
||||
def test_get_by_folder_raises_deprecation_warning(
|
||||
self, temp_directory, sample_serie
|
||||
|
||||
Reference in New Issue
Block a user