Skip to content

Commit

Permalink
unit test updates
Browse files Browse the repository at this point in the history
more unit tests
  • Loading branch information
amaltaro committed May 13, 2022
1 parent dc00e31 commit ae6218d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions test/python/WMCore_t/MicroService_t/MSTransferor_t/Workflow_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,16 @@ def testGetChunkBlocks1(self):
wflow.setPrimaryBlocks(primDict)
blockChunks, sizeChunks = wflow.getChunkBlocks(1)
self.assertEqual(len(blockChunks), 1)
self.assertItemsEqual(blockChunks[0], {"block_A"})
self.assertEqual(len(sizeChunks), 1)
self.assertEqual(sizeChunks[0], 1)
self.assertItemsEqual(blockChunks, {"block_A"})
self.assertEqual(sizeChunks, 1)

# now set a parent
wflow.setParentDataset("Parent_dataset_XXX")
wflow.setParentBlocks(parentDict)
blockChunks, sizeChunks = wflow.getChunkBlocks(1)
self.assertEqual(len(blockChunks), 1)
self.assertItemsEqual(blockChunks[0], {"block_A", "parent_A", "parent_B"})
self.assertEqual(len(sizeChunks), 1)
self.assertEqual(sizeChunks[0], 20)
self.assertEqual(len(blockChunks), 3)
self.assertItemsEqual(blockChunks, {"block_A", "parent_A", "parent_B"})
self.assertEqual(sizeChunks, 20)

def testGetChunkBlocks2(self):
"""
Expand Down Expand Up @@ -345,10 +343,9 @@ def testGetChunkBlocks3(self):
wflow.setChildToParentBlocks(parentage)

blockChunks, sizeChunks = wflow.getChunkBlocks(1)
self.assertEqual(len(blockChunks), 1)
self.assertItemsEqual(blockChunks[0], {"block_A", "block_B", "parent_A", "parent_B", "parent_C"})
self.assertEqual(len(sizeChunks), 1)
self.assertEqual(sizeChunks[0], 39)
self.assertEqual(len(blockChunks), 5)
self.assertItemsEqual(blockChunks, {"block_A", "block_B", "parent_A", "parent_B", "parent_C"})
self.assertEqual(sizeChunks, 39)

blockChunks, sizeChunks = wflow.getChunkBlocks(2)
self.assertEqual(len(blockChunks), 2)
Expand Down

0 comments on commit ae6218d

Please sign in to comment.