|
12 | 12 | # limitations under the License.
|
13 | 13 |
|
14 | 14 | from optimizely import version
|
15 |
| -from optimizely.event.payload import Decision, EventBatch, Snapshot, SnapshotEvent, Visitor, VisitorAttribute |
| 15 | +from optimizely.event import payload |
16 | 16 | from . import base
|
17 | 17 |
|
18 | 18 |
|
@@ -51,15 +51,15 @@ def test_impression_event_equals_serialized_payload(self):
|
51 | 51 | 'revision': '42'
|
52 | 52 | }
|
53 | 53 |
|
54 |
| - batch = EventBatch('12001', '111001', '42', 'python-sdk', version.__version__, |
| 54 | + batch = payload.EventBatch('12001', '111001', '42', 'python-sdk', version.__version__, |
55 | 55 | False, True)
|
56 |
| - visitor_attr = VisitorAttribute('111094', 'test_attribute', 'custom', 'test_value') |
57 |
| - event = SnapshotEvent('111182', 'a68cf1ad-0393-4e18-af87-efe8f01a7c9c', 'campaign_activated', |
| 56 | + visitor_attr = payload.VisitorAttribute('111094', 'test_attribute', 'custom', 'test_value') |
| 57 | + event = payload.SnapshotEvent('111182', 'a68cf1ad-0393-4e18-af87-efe8f01a7c9c', 'campaign_activated', |
58 | 58 | 42123)
|
59 |
| - event_decision = Decision('111182', '111127', '111129') |
| 59 | + event_decision = payload.Decision('111182', '111127', '111129') |
60 | 60 |
|
61 |
| - snapshots = Snapshot([event], [event_decision]) |
62 |
| - user = Visitor([snapshots], [visitor_attr], 'test_user') |
| 61 | + snapshots = payload.Snapshot([event], [event_decision]) |
| 62 | + user = payload.Visitor([snapshots], [visitor_attr], 'test_user') |
63 | 63 |
|
64 | 64 | batch.visitors = [user]
|
65 | 65 |
|
@@ -105,15 +105,15 @@ def test_conversion_event_equals_serialized_payload(self):
|
105 | 105 | 'revision': '42'
|
106 | 106 | }
|
107 | 107 |
|
108 |
| - batch = EventBatch('12001', '111001', '42', 'python-sdk', version.__version__, |
| 108 | + batch = payload.EventBatch('12001', '111001', '42', 'python-sdk', version.__version__, |
109 | 109 | False, True)
|
110 |
| - visitor_attr_1 = VisitorAttribute('111094', 'test_attribute', 'custom', 'test_value') |
111 |
| - visitor_attr_2 = VisitorAttribute('111095', 'test_attribute2', 'custom', 'test_value2') |
112 |
| - event = SnapshotEvent('111182', 'a68cf1ad-0393-4e18-af87-efe8f01a7c9c', 'campaign_activated', |
| 110 | + visitor_attr_1 = payload.VisitorAttribute('111094', 'test_attribute', 'custom', 'test_value') |
| 111 | + visitor_attr_2 = payload.VisitorAttribute('111095', 'test_attribute2', 'custom', 'test_value2') |
| 112 | + event = payload.SnapshotEvent('111182', 'a68cf1ad-0393-4e18-af87-efe8f01a7c9c', 'campaign_activated', |
113 | 113 | 42123, 4200, 1.234, {'revenue': 4200, 'value': 1.234, 'non-revenue': 'abc'})
|
114 | 114 |
|
115 |
| - snapshots = Snapshot([event]) |
116 |
| - user = Visitor([snapshots], [visitor_attr_1, visitor_attr_2], 'test_user') |
| 115 | + snapshots = payload.Snapshot([event]) |
| 116 | + user = payload.Visitor([snapshots], [visitor_attr_1, visitor_attr_2], 'test_user') |
117 | 117 |
|
118 | 118 | batch.visitors = [user]
|
119 | 119 |
|
|
0 commit comments