Skip to content

Commit

Permalink
tests: don't use fancy with for python2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod authored and Duncan Macleod committed Jan 12, 2017
1 parent a454d53 commit 3918d8f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions omicron/tests/test_condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,19 @@ class CondorTests(unittest.TestCase):

def test_submit_dag(self):
shell_ = mock_shell_factory('1 job(s) submitted to cluster 12345')
with mock.patch('omicron.condor.which', mock_which), \
mock.patch('omicron.condor.shell', shell_):
dagid = condor.submit_dag('test.dag')
with utils.capture(condor.submit_dag, 'test.dag', '-append',
'+OmicronDAGMan="GW"') as output:
cmd = output.split('\n')[0]
self.assertEqual(cmd, '$ /path/to/executable -append '
'+OmicronDAGMan="GW" test.dag')
with mock.patch('omicron.condor.which', mock_which):
with mock.patch('omicron.condor.shell', shell_):
dagid = condor.submit_dag('test.dag')
with utils.capture(condor.submit_dag, 'test.dag', '-append',
'+OmicronDAGMan="GW"') as output:
cmd = output.split('\n')[0]
self.assertEqual(cmd, '$ /path/to/executable -append '
'+OmicronDAGMan="GW" test.dag')
self.assertEqual(dagid, 12345)
shell_ = mock_shell_factory('Error')
with mock.patch('omicron.condor.which', mock_which), \
mock.patch('omicron.condor.shell', shell_):
self.assertRaises(AttributeError, condor.submit_dag, 'test.dag')
with mock.patch('omicron.condor.which', mock_which):
with mock.patch('omicron.condor.shell', shell_):
self.assertRaises(AttributeError, condor.submit_dag, 'test.dag')

def test_find_jobs(self):
schedd_ = mock_schedd_factory([{'ClusterId': 1}, {'ClusterId': 2}])
Expand Down

0 comments on commit 3918d8f

Please sign in to comment.