Skip to content

Commit d816194

Browse files
committed
Pylint cleanups
1 parent cacc2a3 commit d816194

File tree

2 files changed

+8
-22
lines changed

2 files changed

+8
-22
lines changed

osgtest/tests/test_190_condorce.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import cagen
2-
import re
32

43
import osgtest.library.core as core
54
import osgtest.library.files as files
65
import osgtest.library.osgunittest as osgunittest
76
import osgtest.library.condor as condor
87
import osgtest.library.service as service
98

9+
1010
class TestStartCondorCE(osgunittest.OSGTestCase):
11-
# Tests 01-02 are needed to reconfigure condor to work with HTCondor-CE
1211
def test_01_configure_condor(self):
1312
core.skip_ok_unless_installed('condor', 'htcondor-ce', 'htcondor-ce-client')
1413

@@ -34,7 +33,7 @@ def test_02_reconfigure_condor(self):
3433

3534
command = ('condor_reconfig', '-debug')
3635
core.check_system(command, 'Reconfigure Condor')
37-
self.assert_(service.is_running('condor', timeout=10), 'Condor not running after reconfig')
36+
self.assertTrue(service.is_running('condor', timeout=10), 'Condor not running after reconfig')
3837

3938
def test_02_scitoken_mapping(self):
4039
core.skip_ok_unless_installed('condor', 'htcondor-ce')

osgtest/tests/test_550_condorce.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
except ImportError:
99
from urllib.request import urlopen
1010

11-
import osgtest.library.condor as condor
1211
import osgtest.library.core as core
1312
import osgtest.library.files as files
1413
import osgtest.library.service as service
@@ -20,6 +19,8 @@ class TestCondorCE(osgunittest.OSGTestCase):
2019
def setUp(self):
2120
# Enforce GSI auth for testing
2221
os.environ['_condor_SEC_CLIENT_AUTHENTICATION_METHODS'] = 'GSI'
22+
core.skip_ok_unless_installed('condor', 'htcondor-ce', 'htcondor-ce-client')
23+
self.skip_bad_unless(service.is_running('condor-ce'), 'ce not running')
2324

2425
def tearDown(self):
2526
os.environ.pop('_condor_SEC_CLIENT_AUTHENTICATION_METHODS')
@@ -64,37 +65,27 @@ def run_blahp_trace(self, lrms):
6465
# S'2'
6566
# p6
6667
# s."
67-
self.assert_(re.search(r'BatchJobId[=\s"\'p1S]+%s' % backend_jobid, cache),
68-
'Job %s not found in %s blahp cache:\n%s' % (backend_jobid, lrms.upper(), cache))
68+
self.assertTrue(re.search(r'BatchJobId[=\s"\'p1S]+%s' % backend_jobid, cache),
69+
'Job %s not found in %s blahp cache:\n%s' % (backend_jobid, lrms.upper(), cache))
6970

7071
os.chdir(cwd)
7172

72-
def general_requirements(self):
73-
core.skip_ok_unless_installed('condor', 'htcondor-ce', 'htcondor-ce-client')
74-
self.skip_bad_unless(service.is_running('condor-ce'), 'ce not running')
75-
7673
def test_01_status(self):
77-
self.general_requirements()
78-
7974
command = ('condor_ce_status', '-any')
8075
core.check_system(command, 'ce status', user=True)
8176

8277
def test_02_queue(self):
83-
self.general_requirements()
84-
8578
command = ('condor_ce_q', '-verbose')
8679
core.check_system(command, 'ce queue', user=True)
8780

8881
def test_03_ping(self):
89-
self.general_requirements()
9082
self.skip_bad_unless(core.state['proxy.valid'], 'requires a proxy cert')
9183

9284
command = ('condor_ce_ping', 'WRITE', '-verbose')
9385
stdout, _, _ = core.check_system(command, 'ping using GSI and gridmap', user=True)
94-
self.assert_(re.search(r'Authorized:\s*TRUE', stdout), 'could not authorize with GSI')
86+
self.assertTrue(re.search(r'Authorized:\s*TRUE', stdout), 'could not authorize with GSI')
9587

9688
def test_04_trace(self):
97-
self.general_requirements()
9889
self.skip_bad_unless(core.state['condor-ce.schedd-ready'], 'CE schedd not ready to accept jobs')
9990
self.skip_bad_unless(core.state['proxy.valid'], 'requires a proxy cert')
10091

@@ -107,7 +98,6 @@ def test_04_trace(self):
10798
os.chdir(cwd)
10899

109100
def test_05_pbs_trace(self):
110-
self.general_requirements()
111101
self.skip_bad_unless(core.state['condor-ce.schedd-ready'], 'CE schedd not ready to accept jobs')
112102
core.skip_ok_unless_installed('torque-mom', 'torque-server', 'torque-scheduler', 'torque-client', 'munge',
113103
by_dependency=True)
@@ -116,7 +106,6 @@ def test_05_pbs_trace(self):
116106
self.run_blahp_trace('pbs')
117107

118108
def test_06_slurm_trace(self):
119-
self.general_requirements()
120109
core.skip_ok_unless_installed(core.SLURM_PACKAGES)
121110
self.skip_bad_unless(service.is_running('munge'), 'slurm requires munge')
122111
self.skip_bad_unless(core.state['condor-ce.schedd-ready'], 'CE schedd not ready to accept jobs')
@@ -126,7 +115,6 @@ def test_06_slurm_trace(self):
126115

127116
def test_07_ceview(self):
128117
core.config['condor-ce.view-listening'] = False
129-
self.general_requirements()
130118
core.skip_ok_unless_installed('htcondor-ce-view')
131119
view_url = 'http://%s:%s' % (core.get_hostname(), int(core.config['condor-ce.view-port']))
132120
try:
@@ -141,6 +129,5 @@ def test_07_ceview(self):
141129
debug_contents += 'Failed to read %s\n' % debug_file
142130
core.log_message(debug_contents)
143131
self.fail('Could not reach HTCondor-CE View at %s: %s' % (view_url, err))
144-
self.assert_(re.search(r'HTCondor-CE Overview', src), 'Failed to find expected CE View contents')
132+
self.assertTrue(re.search(r'HTCondor-CE Overview', src), 'Failed to find expected CE View contents')
145133
core.config['condor-ce.view-listening'] = True
146-

0 commit comments

Comments
 (0)