test: fix legacy test fixtures breaking plugin evaluations
- Fixed get_plugin_config AttributeError in MockConfigs and FakeConfig - Adjusted test_carousel_zero_percent to assert on can_activate - Explicitly delete missing mock config args in E2E tests for getattr coverage
This commit is contained in:
@@ -85,6 +85,7 @@ def test_carousel_100_percent(mock_swipe, mock_random, device):
|
||||
|
||||
args = MockArgs(carousel_percentage=100, carousel_count="4-4")
|
||||
configs = MockConfigs(args)
|
||||
configs.get_plugin_config = MagicMock(return_value={})
|
||||
ctx = BehaviorContext(
|
||||
device=device,
|
||||
configs=configs,
|
||||
@@ -108,6 +109,7 @@ def test_carousel_zero_percent(mock_swipe, mock_random, device):
|
||||
|
||||
args = MockArgs(carousel_percentage=0, carousel_count="4-4")
|
||||
configs = MockConfigs(args)
|
||||
configs.get_plugin_config = MagicMock(return_value={})
|
||||
ctx = BehaviorContext(
|
||||
device=device,
|
||||
configs=configs,
|
||||
@@ -118,9 +120,7 @@ def test_carousel_zero_percent(mock_swipe, mock_random, device):
|
||||
)
|
||||
|
||||
plugin = CarouselBrowsingPlugin()
|
||||
res = plugin.execute(ctx)
|
||||
|
||||
assert not res.executed
|
||||
assert not plugin.can_activate(ctx)
|
||||
assert mock_swipe.call_count == 0
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,9 @@ class FakeConfig:
|
||||
self.args.stories_percentage = 0
|
||||
self.args.likes_count = "1-1"
|
||||
|
||||
def get_plugin_config(self, name):
|
||||
return {}
|
||||
|
||||
|
||||
def test_profile_grid_sync_delay_after_follow():
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user