Changeset 451bb19 in flex_extract.git
- Timestamp:
- Aug 31, 2018, 4:12:03 PM (6 years ago)
- Branches:
- master, ctbto, dev
- Children:
- 763fcf6
- Parents:
- 2ad8ea5
- Location:
- python
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/pythontest/TestTools.py
r2ad8ea5 r451bb19 10 10 import _config 11 11 from tools import (init128, to_param_id, my_error, read_ecenv, 12 get_cmdline_arguments )12 get_cmdline_arguments, submit_job_to_ecserver) 13 13 14 14 … … 77 77 assert par in [130, 134, 142, 146] 78 78 79 def test_ error_notifcation(self):79 def test_my_error(self): 80 80 ''' 81 81 ''' … … 109 109 assert True 110 110 111 112 111 def test_get_list_as_string(self): 113 112 assert True … … 118 117 def test_put_file_to_ecserver(self): 119 118 assert True 119 #assert subprocess.call(['ssh', host, 'test -e ' + pipes.quote(path)]) == 0 120 120 121 def submit_job_to_ecserver(self): 122 assert True 121 def test_fail_submit_job_to_ecserver(self): 122 with pytest.raises(SystemExit) as pytest_wrapped_e: 123 submit_job_to_ecserver('${HOME}', 'ecgate', 'job.ksh') 124 assert pytest_wrapped_e.type == SystemExit 125 assert pytest_wrapped_e.value.code == '... ECACCESS-JOB-SUBMIT FAILED!' 126 127 def test_success_submit_job_to_ecserver(self): 128 129 result = submit_job_to_ecserver('TestData/testfile.txt', 130 'ecgate', 'TestData/testfile.txt') 131 assert result == 0 132 133 123 134 124 135 if __name__ == "__main__": -
python/tools.py
r54a8a01 r451bb19 500 500 501 501 @Return: 502 <nothing> 502 rcode: integer 503 Resulting code of subprocess.check_call. 503 504 ''' 504 505 505 506 try: 506 subprocess.check_call(['ecaccess-job-submit',507 '-queueName', target,508 jobname])507 rcode = subprocess.check_call(['ecaccess-job-submit', 508 '-queueName', target, 509 jobname]) 509 510 except subprocess.CalledProcessError as e: 510 511 print '... ERROR CODE: ', e.returncode 511 512 sys.exit('... ECACCESS-JOB-SUBMIT FAILED!') 512 513 513 return 514 return rcode
Note: See TracChangeset
for help on using the changeset viewer.