Skip to content

Commit

Permalink
Merge pull request dmwm#4611 from dballesteros7/unittest
Browse files Browse the repository at this point in the history
Bugfix unit test for python 2.6 vs 2.7
  • Loading branch information
ericvaandering committed May 15, 2013
2 parents bcfab73 + d482b3a commit f796ee0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/python/WMComponent_t/DBS3Buffer_t/DBSUpload_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ def testCloseSettingsPerWorkflow(self):
fakeDBS.close()
self.assertEqual(len(fakeDBSInfo), 2)
for block in fakeDBSInfo:
self.assertNotIn('block_events', block['block'])
self.assertTrue('block_events' not in block['block'])
self.assertEqual(block['block']['file_count'], 7)
self.assertEqual(block['block']['open_for_writing'], 0)
self.assertNotIn('close_settings', block)
self.assertTrue('close_settings' not in block)
time.sleep(3)
dbsUploader.algorithm()
openBlocks = dbsUtil.findOpenBlocks()
Expand All @@ -498,9 +498,9 @@ def testCloseSettingsPerWorkflow(self):
for block in fakeDBSInfo:
if block['block']['file_count'] != 6:
self.assertEqual(block['block']['file_count'], 7)
self.assertNotIn('block_events', block['block'])
self.assertTrue('block_events' not in block['block'])
self.assertEqual(block['block']['open_for_writing'], 0)
self.assertNotIn('close_settings', block)
self.assertTrue('close_settings' not in block)

# Now check the limit by size and timeout with new files
acqEra = "TropicalSeason%s" % (int(time.time()))
Expand All @@ -523,8 +523,8 @@ def testCloseSettingsPerWorkflow(self):
for block in fakeDBSInfo:
if acqEra in block['block']['block_name']:
self.assertEqual(block['block']['file_count'], 5)
self.assertNotIn('block_events', block['block'])
self.assertNotIn('close_settings', block)
self.assertTrue('block_events' not in block['block'])
self.assertTrue('close_settings' not in block)
self.assertEqual(block['block']['open_for_writing'], 0)

# Put more files, they will go into the same block and then it will be closed
Expand All @@ -547,9 +547,9 @@ def testCloseSettingsPerWorkflow(self):
self.assertEqual(block['block']['file_count'], 4)
else:
self.assertEqual(block['block']['file_count'], 5)
self.assertNotIn('block_events', block['block'])
self.assertTrue('block_events' not in block['block'])
self.assertEqual(block['block']['open_for_writing'], 0)
self.assertNotIn('close_settings', block)
self.assertTrue('close_settings' not in block)

# Finally test size limits
acqEra = "TropicalSeason%s" % (int(time.time()))
Expand All @@ -575,9 +575,9 @@ def testCloseSettingsPerWorkflow(self):
if block['block']['file_count'] != 1:
self.assertEqual(block['block']['block_size'], 2048)
self.assertEqual(block['block']['file_count'], 2)
self.assertNotIn('block_events', block['block'])
self.assertTrue('block_events' not in block['block'])
self.assertEqual(block['block']['open_for_writing'], 0)
self.assertNotIn('close_settings', block)
self.assertTrue('close_settings' not in block)
except:
self.fail("We failed at some point in the test")
finally:
Expand Down

0 comments on commit f796ee0

Please sign in to comment.