Skip to content

Commit

Permalink
Add check for container fraction update in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Mar 6, 2024
1 parent f35e49e commit b181383
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,20 @@ def testUpdateTransitionRecord(self):
self.assertTrue(trec['DN'], self.userDN)

# test when our document contains smaller fraction
doc['containerFraction'] = 0.5
fraction = 0.5
doc['containerFraction'] = fraction
doc['transition'] = [self.tranRecord]
updateTransitionRecord(doc, userDN, self.logger)
self.logger.info("2nd test (container fraction) %s", doc)
self.assertTrue(len(doc['transition']), 2)
# check that all transition record have the same DN
for trec in doc['transition']:
self.assertTrue(trec['DN'], self.userDN)
# check container fraction of last record
trec = doc['transition'][-1]
self.logger.info("trec %s", trec)
self.assertTrue(trec['containerFraction'], fraction)


# test use-case when we supply the same container fraction
updateTransitionRecord(doc, self.userDN, self.logger)
Expand Down

0 comments on commit b181383

Please sign in to comment.