mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-06-08 10:57:26 +08:00
fix: Update tests to handle openpyxl color format and ContextVar
- Fix header color assertion to check only RGB values (not alpha channel) - Remove ContextVar mock as it cannot be patched in Python 3.11+ - All 17 tests now passing successfully
This commit is contained in:
@@ -51,9 +51,9 @@ class TestXhsStoreFactory:
|
||||
assert isinstance(store, XhsMongoStoreImplement)
|
||||
|
||||
@patch('config.SAVE_DATA_OPTION', 'excel')
|
||||
@patch('var.crawler_type_var.get', return_value='search')
|
||||
def test_create_excel_store(self, mock_crawler_type):
|
||||
def test_create_excel_store(self):
|
||||
"""Test creating Excel store"""
|
||||
# ContextVar cannot be mocked, so we test with actual value
|
||||
store = XhsStoreFactory.create_store()
|
||||
assert isinstance(store, XhsExcelStoreImplement)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user