@@ -381,263 +381,3 @@ def setUp(self):
381381
382382 self .optimizely = optimizely .Optimizely (json .dumps (self .config_dict ))
383383 self .project_config = self .optimizely .config
384-
385-
386- class BaseTestV3 (unittest .TestCase ):
387-
388- def setUp (self ):
389- self .config_dict = {
390- 'revision' : '42' ,
391- 'version' : '2' ,
392- 'events' : [{
393- 'key' : 'test_event' ,
394- 'experimentIds' : ['111127' ],
395- 'id' : '111095'
396- }, {
397- 'key' : 'Total Revenue' ,
398- 'experimentIds' : ['111127' ],
399- 'id' : '111096'
400- }],
401- 'experiments' : [{
402- 'key' : 'test_experiment' ,
403- 'status' : 'Running' ,
404- 'forcedVariations' : {
405- 'user_1' : 'control' ,
406- 'user_2' : 'control'
407- },
408- 'layerId' : '111182' ,
409- 'audienceIds' : ['11154' ],
410- 'trafficAllocation' : [{
411- 'entityId' : '111128' ,
412- 'endOfRange' : 4000
413- }, {
414- 'entityId' : '' ,
415- 'endOfRange' : 5000
416- }, {
417- 'entityId' : '111129' ,
418- 'endOfRange' : 9000
419- }],
420- 'id' : '111127' ,
421- 'variations' : [{
422- 'key' : 'control' ,
423- 'id' : '111128'
424- }, {
425- 'key' : 'variation' ,
426- 'id' : '111129'
427- }]
428- }],
429- 'groups' : [{
430- 'id' : '19228' ,
431- 'policy' : 'random' ,
432- 'experiments' : [{
433- 'id' : '32222' ,
434- 'key' : 'group_exp_1' ,
435- 'status' : 'Running' ,
436- 'audienceIds' : [],
437- 'layerId' : '111183' ,
438- 'variations' : [{
439- 'key' : 'group_exp_1_control' ,
440- 'id' : '28901'
441- }, {
442- 'key' : 'group_exp_1_variation' ,
443- 'id' : '28902'
444- }],
445- 'forcedVariations' : {
446- 'user_1' : 'group_exp_1_control' ,
447- 'user_2' : 'group_exp_1_control'
448- },
449- 'trafficAllocation' : [{
450- 'entityId' : '28901' ,
451- 'endOfRange' : 3000
452- }, {
453- 'entityId' : '28902' ,
454- 'endOfRange' : 9000
455- }]
456- }, {
457- 'id' : '32223' ,
458- 'key' : 'group_exp_2' ,
459- 'status' : 'Running' ,
460- 'audienceIds' : [],
461- 'layerId' : '111184' ,
462- 'variations' : [{
463- 'key' : 'group_exp_2_control' ,
464- 'id' : '28905'
465- }, {
466- 'key' : 'group_exp_2_variation' ,
467- 'id' : '28906'
468- }],
469- 'forcedVariations' : {
470- 'user_1' : 'group_exp_2_control' ,
471- 'user_2' : 'group_exp_2_control'
472- },
473- 'trafficAllocation' : [{
474- 'entityId' : '28905' ,
475- 'endOfRange' : 8000
476- }, {
477- 'entityId' : '28906' ,
478- 'endOfRange' : 10000
479- }]
480- }],
481- 'trafficAllocation' : [{
482- 'entityId' : '32222' ,
483- "endOfRange" : 3000
484- }, {
485- 'entityId' : '32223' ,
486- 'endOfRange' : 7500
487- }]
488- }],
489- 'accountId' : '12001' ,
490- 'attributes' : [{
491- 'key' : 'test_attribute' ,
492- 'id' : '111094'
493- }],
494- 'audiences' : [{
495- 'name' : 'Test attribute users' ,
496- 'conditions' : '["and", ["or", ["or", '
497- '{"name": "test_attribute", "type": "custom_attribute", "value": "test_value_1"}]]]' ,
498- 'id' : '11154'
499- }, {
500- 'name' : 'Test attribute users' ,
501- 'conditions' : '["and", ["or", ["or", '
502- '{"name": "test_attribute", "type": "custom_attribute", "value": "test_value_2"}]]]' ,
503- 'id' : '11159'
504- }],
505- 'projectId' : '111001'
506- }
507-
508- # datafile version 4
509- self .config_dict_with_features = {
510- 'revision' : '1' ,
511- 'accountId' : '12001' ,
512- 'projectId' : '111111' ,
513- 'version' : '4' ,
514- 'events' : [{
515- 'key' : 'test_event' ,
516- 'experimentIds' : ['111127' ],
517- 'id' : '111095'
518- }],
519- 'experiments' : [{
520- 'key' : 'test_experiment' ,
521- 'status' : 'Running' ,
522- 'forcedVariations' : {},
523- 'layerId' : '111182' ,
524- 'audienceIds' : [],
525- 'trafficAllocation' : [{
526- 'entityId' : '111128' ,
527- 'endOfRange' : 5000
528- }, {
529- 'entityId' : '111129' ,
530- 'endOfRange' : 9000
531- }],
532- 'id' : '111127' ,
533- 'variations' : [{
534- 'key' : 'control' ,
535- 'id' : '111128' ,
536- 'variables' : [{
537- 'id' : '127' , 'value' : 'false'
538- }, {
539- 'id' : '128' , 'value' : 'prod'
540- }]
541- }, {
542- 'key' : 'variation' ,
543- 'id' : '111129'
544- }]
545- }],
546- 'groups' : [],
547- 'attributes' : [{
548- 'key' : 'test_attribute' ,
549- 'id' : '111094'
550- }],
551- 'audiences' : [{
552- 'name' : 'Test attribute users 1' ,
553- 'conditions' : '["and", ["or", ["or", '
554- '{"name": "test_attribute", "type": "custom_attribute", "value": "test_value_1"}]]]' ,
555- 'id' : '11154'
556- }, {
557- 'name' : 'Test attribute users 2' ,
558- 'conditions' : '["and", ["or", ["or", '
559- '{"name": "test_attribute", "type": "custom_attribute", "value": "test_value_2"}]]]' ,
560- 'id' : '11159'
561- }],
562- 'rollouts' : [{
563- 'id' : '201111' ,
564- 'experiments' : []
565- }, {
566- 'id' : '211111' ,
567- 'experiments' : [{
568- 'id' : '211127' ,
569- 'key' : '211127' ,
570- 'status' : 'Running' ,
571- 'forcedVariations' : {},
572- 'layerId' : '211111' ,
573- 'audienceIds' : ['11154' ],
574- 'trafficAllocation' : [{
575- 'entityId' : '211129' ,
576- 'endOfRange' : 9000
577- }],
578- 'variations' : [{
579- 'key' : '211129' ,
580- 'id' : '211129'
581- }]
582- }, {
583- 'id' : '211137' ,
584- 'key' : '211137' ,
585- 'status' : 'Running' ,
586- 'forcedVariations' : {},
587- 'layerId' : '211111' ,
588- 'audienceIds' : ['11159' ],
589- 'trafficAllocation' : [{
590- 'entityId' : '211139' ,
591- 'endOfRange' : 3000
592- }],
593- 'variations' : [{
594- 'key' : '211139' ,
595- 'id' : '211139'
596- }]
597- }, {
598- 'id' : '211147' ,
599- 'key' : '211147' ,
600- 'status' : 'Running' ,
601- 'forcedVariations' : {},
602- 'layerId' : '211111' ,
603- 'audienceIds' : [],
604- 'trafficAllocation' : [{
605- 'entityId' : '211149' ,
606- 'endOfRange' : 6000
607- }],
608- 'variations' : [{
609- 'key' : '211149' ,
610- 'id' : '211149'
611- }]
612- }]
613- }],
614- 'featureFlags' : [{
615- 'id' : '91111' ,
616- 'key' : '91111' ,
617- 'experimentIds' : ['111127' ],
618- 'rolloutId' : '' ,
619- 'variables' : [{
620- 'id' : '127' ,
621- 'key' : '127' ,
622- 'defaultValue' : 'true' ,
623- 'type' : 'boolean' ,
624- }, {
625- 'id' : '128' ,
626- 'key' : '128' ,
627- 'defaultValue' : 'devel' ,
628- 'type' : 'string' ,
629- }]
630- }, {
631- 'id' : '91112' ,
632- 'key' : '91112' ,
633- 'experimentIds' : [],
634- 'rolloutId' : '211111' ,
635- 'variables' : [],
636- }]
637- }
638-
639- self .optimizely = optimizely .Optimizely (json .dumps (self .config_dict ))
640- self .config = project_config .ProjectConfig (json .dumps (self .config_dict ),
641- logger .SimpleLogger (), error_handler .NoOpErrorHandler ())
642- self .optimizely .event_builder = event_builder .EventBuilderV3 (self .config )
643- self .project_config = self .optimizely .config
0 commit comments