# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### # ___INFO__MARK_END__ import datetime from drmaa2 import JobInfo if __name__ == '__main__': import datetime print('Impl. spec. keys: %s' % JobInfo.get_implementation_specific_keys()) ji = JobInfo({'queue_name': 'all.q'}) print('Initial job info: %s' % ji) ji.job_id = '113' ji.job_name = 'job-01' ji.slots = 10 ji.job_owner = 'a.user' ji.submission_time = datetime.datetime.now() ji.cpu_time = 77 ji.set_impl_spec_key_value('uge_ji_priority', '23') print('Impl. spec. key uge_ji_priority is set to: %s' % ji.get_impl_spec_key_value('uge_ji_priority')) print('Impl. spec dictionary: %s' % ji.implementation_specific) print('Final job info: %s' % ji)
def test_job_name_attr(): ji = JobInfo() job_name = generate_random_string() ji.job_name = job_name assert (ji.job_name == job_name) print('\nJob info with job_name: %s' % (job_name))