-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest_events_manager_config.py
More file actions
34 lines (26 loc) · 1.48 KB
/
test_events_manager_config.py
File metadata and controls
34 lines (26 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""EventsManagerConfig test module."""
import pytest
from splitio.events.events_manager_config import EventsManagerConfig
from splitio.models.events import SdkEvent, SdkInternalEvent
class EventsManagerConfigTests(object):
"""Tests for EventsManagerConfig."""
def test_build_instance(self):
config = EventsManagerConfig()
assert len(config.require_all[SdkEvent.SDK_READY]) == 1
assert SdkInternalEvent.SDK_READY in config.require_all[SdkEvent.SDK_READY]
assert SdkEvent.SDK_READY in config.prerequisites[SdkEvent.SDK_UPDATE]
assert config.execution_limits[SdkEvent.SDK_UPDATE] == -1
assert config.execution_limits[SdkEvent.SDK_READY] == 1
assert len(config.require_any[SdkEvent.SDK_UPDATE]) == 4
assert SdkInternalEvent.FLAG_KILLED_NOTIFICATION in config.require_any[SdkEvent.SDK_UPDATE]
assert SdkInternalEvent.FLAGS_UPDATED in config.require_any[SdkEvent.SDK_UPDATE]
assert SdkInternalEvent.RB_SEGMENTS_UPDATED in config.require_any[SdkEvent.SDK_UPDATE]
assert SdkInternalEvent.SEGMENTS_UPDATED in config.require_any[SdkEvent.SDK_UPDATE]
order = 0
assert len(config.evaluation_order) == 2
for sdk_event in config.evaluation_order:
order += 1
if order == 1:
assert sdk_event == SdkEvent.SDK_READY
if order == 2:
assert sdk_event == SdkEvent.SDK_UPDATE