Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5c0640a

Browse files
committed
Adding unit test
1 parent 9b78907 commit 5c0640a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

splitio/tests/test_splits.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,12 @@ def setUp(self):
10631063
raw_split['trafficAllocationSeed'] = -1
10641064
self._splitObjects['rollout2'] = split_parser.parse(raw_split, True)
10651065

1066+
raw_split['name'] = 'test4'
1067+
raw_split['trafficAllocation'] = None #must be mapped as 100
1068+
raw_split['trafficAllocationSeed'] = -1
1069+
self._splitObjects['rollout3'] = split_parser.parse(raw_split, True)
1070+
1071+
10661072
def testTrafficAllocation(self):
10671073
'''
10681074
'''
@@ -1080,3 +1086,8 @@ def testTrafficAllocation(self):
10801086
self._splitObjects['rollout2'], 'testKey', None
10811087
)
10821088
self.assertEqual(treatment3, 'default')
1089+
1090+
treatment4, label1 = self._client._get_treatment_for_split(
1091+
self._splitObjects['rollout3'], 'testKey', None
1092+
)
1093+
self.assertEqual(treatment4, 'on')

0 commit comments

Comments
 (0)