Best Python code snippet using robotframework-appiumlibrary_python
test_dynamic_tool_destination.py
Source:test_dynamic_tool_destination.py
...67 # =======================map_tool_to_destination()================================68 @log_capture()69 def test_brokenDestYML(self, l):70 self.assertRaises(JobMappingException, map_tool_to_destination, runJob, theApp, vanillaTool, "user@email.com", True, broken_default_dest_path, job_conf_path)71 l.check_present(72 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),73 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'No global default destination specified in config!'),74 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),75 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test3.full'),76 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 3.23 KB'),77 )78 @log_capture()79 def test_filesize_empty(self, l):80 self.assertRaises(JobMappingException, map_tool_to_destination, emptyJob, theApp, vanillaTool, "user@email.com", True, path, job_conf_path)81 self.assertRaises(JobMappingException, map_tool_to_destination, emptyJob, theApp, vanillaTool, "user@email.com", True, priority_path, job_conf_path)82 l.check_present(83 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),84 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),85 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.empty'),86 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 0.00 B'),87 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1'),88 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),89 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),90 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),91 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.empty'),92 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 0.00 B'),93 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1')94 )95 @log_capture()96 def test_filesize_zero(self, l):97 self.assertRaises(JobMappingException, map_tool_to_destination, zeroJob, theApp, vanillaTool, "user@email.com", True, path, job_conf_path)98 self.assertRaises(JobMappingException, map_tool_to_destination, zeroJob, theApp, vanillaTool, "user@email.com", True, priority_path, job_conf_path)99 l.check_present(100 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),101 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),102 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 0.00 B'),103 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 0'),104 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),105 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),106 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),107 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 0.00 B'),108 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 0')109 )110 @log_capture()111 def test_filesize_fail(self, l):112 self.assertRaises(JobMappingException, map_tool_to_destination, failJob, theApp, vanillaTool, "user@email.com", True, path, job_conf_path)113 self.assertRaises(JobMappingException, map_tool_to_destination, failJob, theApp, vanillaTool, "user@email.com", True, priority_path, job_conf_path)114 l.check_present(115 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),116 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),117 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test1.full'),118 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 293.00 B'),119 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1'),120 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),121 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),122 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),123 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test1.full'),124 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 293.00 B'),125 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1')126 )127 @log_capture()128 def test_filesize_run(self, l):129 job = map_tool_to_destination(runJob, theApp, vanillaTool, "user@email.com", True, path, job_conf_path)130 self.assertEqual(job, 'Destination1')131 priority_job = map_tool_to_destination(runJob, theApp, vanillaTool, "user@email.com", True, priority_path, job_conf_path)132 self.assertEqual(priority_job, 'Destination1_high')133 l.check_present(134 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),135 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),136 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test3.full'),137 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 3.23 KB'),138 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1'),139 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test' with 'Destination1'."),140 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),141 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),142 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),143 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test3.full'),144 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total size: 3.23 KB'),145 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total number of files: 1'),146 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test' with 'Destination1_high'.")147 )148 @log_capture()149 def test_default_tool(self, l):150 job = map_tool_to_destination(runJob, theApp, defaultTool, "user@email.com", True, path, job_conf_path)151 self.assertEqual(job, 'cluster_default')152 priority_job = map_tool_to_destination(runJob, theApp, defaultTool, "user@email.com", True, priority_path, job_conf_path)153 self.assertEqual(priority_job, 'cluster_default_high')154 l.check_present(155 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),156 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),157 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'test_tooldefault' not specified in config. Using default destination."),158 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_tooldefault' with 'cluster_default'."),159 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),160 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),161 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),162 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'test_tooldefault' not specified in config. Using default destination."),163 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_tooldefault' with 'cluster_default_high'.")164 )165 @log_capture()166 def test_arguments_tool(self, l):167 job = map_tool_to_destination(argJob, theApp, argTool, "user@email.com", True, path, job_conf_path)168 self.assertEqual(job, 'Destination6')169 priority_job = map_tool_to_destination(argJob, theApp, argTool, "user@email.com", True, priority_path, job_conf_path)170 self.assertEqual(priority_job, 'Destination6_med')171 l.check_present(172 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),173 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),174 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_arguments' with 'Destination6'."),175 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),176 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),177 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),178 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_arguments' with 'Destination6_med'.")179 )180 @log_capture()181 def test_arguments_arg_not_found(self, l):182 job = map_tool_to_destination(argNotFoundJob, theApp, argTool, "user@email.com", True, path, job_conf_path)183 self.assertEqual(job, 'cluster_default')184 priority_job = map_tool_to_destination(argNotFoundJob, theApp, argTool, "user@email.com", True, priority_path, job_conf_path)185 self.assertEqual(priority_job, 'cluster_default_high')186 l.check_present(187 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),188 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),189 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_arguments' with 'cluster_default'."),190 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),191 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),192 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),193 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_arguments' with 'cluster_default_high'.")194 )195 @log_capture()196 def test_tool_not_found(self, l):197 job = map_tool_to_destination(runJob, theApp, unTool, "user@email.com", True, path, job_conf_path)198 self.assertEqual(job, 'cluster_default')199 priority_job = map_tool_to_destination(runJob, theApp, unTool, "user@email.com", True, priority_path, job_conf_path)200 self.assertEqual(priority_job, 'cluster_default_high')201 l.check_present(202 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),203 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),204 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'unregistered' not specified in config. Using default destination."),205 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'unregistered' with 'cluster_default'."),206 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),207 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),208 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),209 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'unregistered' not specified in config. Using default destination."),210 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'unregistered' with 'cluster_default_high'.")211 )212 @log_capture()213 def test_fasta(self, l):214 job = map_tool_to_destination(dbJob, theApp, dbTool, "user@email.com", True, path, job_conf_path)215 self.assertEqual(job, 'Destination4')216 priority_job = map_tool_to_destination(dbJob, theApp, dbTool, "user@email.com", True, priority_path, job_conf_path)217 self.assertEqual(priority_job, 'Destination4_high')218 l.check_present(219 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),220 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),221 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.fasta'),222 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total amount of records: 10'),223 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_db' with 'Destination4'."),224 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),225 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),226 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),227 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.fasta'),228 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total amount of records: 10'),229 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_db' with 'Destination4_high'.")230 )231 @log_capture()232 def test_fasta_count(self, l):233 job = map_tool_to_destination(dbcountJob, theApp, dbTool, "user@email.com", True, path, job_conf_path)234 self.assertEqual(job, 'Destination4')235 priority_job = map_tool_to_destination(dbcountJob, theApp, dbTool, "user@email.com", True, priority_path, job_conf_path)236 self.assertEqual(priority_job, 'Destination4_high')237 l.check_present(238 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),239 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),240 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.fasta'),241 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total amount of records: 6'),242 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_db' with 'Destination4'."),243 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),244 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),245 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),246 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Loading file: input1' + script_dir + '/data/test.fasta'),247 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Total amount of records: 6'),248 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_db' with 'Destination4_high'.")249 )250 @log_capture()251 def test_no_verbose(self, l):252 job = map_tool_to_destination(runJob, theApp, noVBTool, "user@email.com", True, no_verbose_path, job_conf_path)253 self.assertEqual(job, 'Destination1')254 l.check_present(255 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_no_verbose' with 'Destination1'.")256 )257 @log_capture()258 def test_authorized_user(self, l):259 job = map_tool_to_destination(runJob, theApp, usersTool, "user@email.com", True, users_test_path, job_conf_path)260 self.assertEqual(job, 'special_cluster')261 l.check_present(262 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_users' with 'special_cluster'."),263 )264 @log_capture()265 def test_unauthorized_user(self, l):266 job = map_tool_to_destination(runJob, theApp, usersTool, "userblah@email.com", True, users_test_path, job_conf_path)267 self.assertEqual(job, 'lame_cluster')268 l.check_present(269 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Running 'test_users' with 'lame_cluster'.")270 )271# ================================Invalid yaml files==============================272 @log_capture()273 def test_no_file(self, l):274 self.assertRaises(IOError, dt.parse_yaml, path="")275 l.check_present()276 @log_capture()277 def test_bad_nice(self, l):278 dt.parse_yaml(path=yt.ivYMLTest11, job_conf_path=job_conf_path, test=True)279 l.check_present(280 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG',281 "Running config validation..."),282 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG',283 "nice_value goes from -20 to 20; rule 1 in 'spades' has a nice_value of '-21'. Setting nice_value to 0."),284 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')285 )286 @log_capture()287 def test_empty_file(self, l):288 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest2, job_conf_path=job_conf_path, test=True), {})289 @log_capture()290 def test_no_tool_name(self, l):291 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest3, job_conf_path=job_conf_path, test=True), yt.iv3dict)292 l.check_present(293 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),294 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Malformed YML; expected job name, but found a list instead!'),295 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')296 )297 @log_capture()298 def test_no_rule_type(self, l):299 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest4, job_conf_path=job_conf_path, test=True), yt.ivDict)300 l.check_present(301 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),302 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No rule_type found for rule 1 in 'spades'."),303 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')304 )305 @log_capture()306 def test_no_rule_lower_bound(self, l):307 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest51, job_conf_path=job_conf_path, test=True), yt.ivDict)308 l.check_present(309 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),310 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Missing bounds for rule 1 in 'spades'. Ignoring rule."),311 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')312 )313 @log_capture()314 def test_no_rule_upper_bound(self, l):315 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest52, job_conf_path=job_conf_path, test=True), yt.ivDict)316 l.check_present(317 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),318 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Missing bounds for rule 1 in 'spades'. Ignoring rule."),319 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')320 )321 @log_capture()322 def test_no_rule_arg(self, l):323 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest53, job_conf_path=job_conf_path, test=True), yt.ivDict53)324 l.check_present(325 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),326 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Found a fail_message for rule 1 in 'spades', but destination is not 'fail'! Setting destination to 'fail'."),327 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')328 )329 @log_capture()330 def test_bad_rule_type(self, l):331 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest6, job_conf_path=job_conf_path, test=True), yt.ivDict)332 l.check_present(333 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),334 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Unrecognized rule_type 'iencs' found in 'spades'. Ignoring..."),335 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')336 )337 @log_capture()338 def test_no_err_msg(self, l):339 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest91, job_conf_path=job_conf_path, test=True), yt.iv91dict)340 l.check_present(341 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),342 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No nice_value found for rule 1 in 'spades'. Setting nice_value to 0."),343 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Missing a fail_message for rule 1 in 'spades'. Adding generic fail_message."),344 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')345 )346 @log_capture()347 def test_no_default_dest(self, l):348 dt.parse_yaml(path=yt.ivYMLTest7, job_conf_path=job_conf_path, test=True)349 l.check_present(350 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),351 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'No global default destination specified in config!'),352 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')353 )354 @log_capture()355 def test_invalid_category(self, l):356 dt.parse_yaml(path=yt.ivYMLTest8, job_conf_path=job_conf_path, test=True)357 l.check_present(358 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),359 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'No global default destination specified in config!'),360 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Unrecognized category 'ice_cream' found in config file!"),361 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')362 )363 @log_capture()364 def test_arguments_no_err_msg(self, l):365 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest12, job_conf_path=job_conf_path, test=True), yt.iv12dict)366 l.check_present(367 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),368 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG',369 "Missing a fail_message for rule 1 in 'spades'. Adding generic fail_message."),370 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')371 )372 @log_capture()373 def test_arguments_no_args(self, l):374 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest131, job_conf_path=job_conf_path, test=True), yt.iv131dict)375 l.check_present(376 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),377 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG',378 "No arguments found for rule 1 in 'spades' despite being of type arguments. Ignoring rule."),379 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')380 )381 @log_capture()382 def test_arguments_no_arg(self, l):383 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest132, job_conf_path=job_conf_path, test=True), yt.iv132dict)384 l.check_present(385 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),386 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Found a fail_message for rule 1 in 'spades', but destination is not 'fail'! Setting destination to 'fail'."),387 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')388 )389 @log_capture()390 def test_return_bool_for_multiple_jobs(self, l):391 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest133, job_conf_path=job_conf_path, test=True, return_bool=True))392 l.check_present(393 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Missing a fail_message for rule 1 in 'smalt'.")394 )395 @log_capture()396 def test_return_rule_for_multiple_jobs(self, l):397 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest133, job_conf_path=job_conf_path, test=True), yt.iv133dict)398 l.check_present(399 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),400 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Missing a fail_message for rule 1 in 'smalt'. Adding generic fail_message."),401 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')402 )403 @log_capture()404 def test_return_bool_for_no_destination(self, l):405 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest134, job_conf_path=job_conf_path, test=True, return_bool=True))406 l.check_present(407 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No destination specified for rule 1 in 'spades'.")408 )409 @log_capture()410 def test_return_rule_for_no_destination(self, l):411 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest134, job_conf_path=job_conf_path, test=True), yt.iv134dict)412 l.check_present(413 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),414 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No destination specified for rule 1 in 'spades'. Ignoring..."),415 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')416 )417 @log_capture()418 def test_return_rule_for_reversed_bounds(self, l):419 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest135, job_conf_path=job_conf_path, test=True), yt.iv135dict)420 l.check_present(421 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),422 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "lower_bound exceeds upper_bound for rule 1 in 'spades'. Reversing bounds."),423 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')424 )425 @log_capture()426 def test_return_bool_for_missing_tool_fields(self, l):427 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest136, job_conf_path=job_conf_path, test=True, return_bool=True))428 l.check_present(429 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'spades' does not have rules nor a default_destination!")430 )431 @log_capture()432 def test_return_rule_for_missing_tool_fields(self, l):433 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest136, job_conf_path=job_conf_path, test=True), yt.iv136dict)434 l.check_present(435 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),436 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'spades' does not have rules nor a default_destination!"),437 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')438 )439 @log_capture()440 def test_return_bool_for_blank_tool(self, l):441 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest137, job_conf_path=job_conf_path, test=True, return_bool=True))442 l.check_present(443 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Config section for tool 'spades' is blank!")444 )445 @log_capture()446 def test_return_rule_for_blank_tool(self, l):447 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest137, job_conf_path=job_conf_path, test=True), yt.iv137dict)448 l.check_present(449 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),450 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Config section for tool 'spades' is blank!"),451 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')452 )453 @log_capture()454 def test_return_bool_for_malformed_users(self, l):455 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest138, job_conf_path=job_conf_path, test=True, return_bool=True))456 l.check_present(457 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry '123' in users for rule 1 in tool 'spades' is in an invalid format!"),458 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invaliduser.email@com' for rule 1 in tool 'spades' is in an invalid format!")459 )460 @log_capture()461 def test_return_rule_for_malformed_users(self, l):462 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest138, job_conf_path=job_conf_path, test=True), yt.iv138dict)463 l.check_present(464 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),465 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry '123' in users for rule 1 in tool 'spades' is in an invalid format! Ignoring entry."),466 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invaliduser.email@com' for rule 1 in tool 'spades' is in an invalid format! Ignoring email."),467 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')468 )469 @log_capture()470 def test_return_bool_for_no_users(self, l):471 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest139, job_conf_path=job_conf_path, test=True, return_bool=True))472 l.check_present(473 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Couldn't find a list under 'users:'!")474 )475 @log_capture()476 def test_return_rule_for_no_users(self, l):477 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest139, job_conf_path=job_conf_path, test=True), yt.iv139dict)478 l.check_present(479 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),480 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Couldn't find a list under 'users:'! Ignoring rule."),481 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')482 )483 @log_capture()484 def test_return_bool_for_malformed_user_email(self, l):485 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest140, job_conf_path=job_conf_path, test=True, return_bool=True))486 l.check_present(487 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invalid.user2@com' for rule 2 in tool 'spades' is in an invalid format!"),488 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invalid.user1@com' for rule 2 in tool 'spades' is in an invalid format!"),489 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No valid user emails were specified for rule 2 in tool 'spades'!")490 )491 @log_capture()492 def test_return_rule_for_malformed_user_email(self, l):493 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest140, job_conf_path=job_conf_path, test=True), yt.iv140dict)494 l.check_present(495 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),496 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invalid.user2@com' for rule 2 in tool 'spades' is in an invalid format! Ignoring email."),497 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Supplied email 'invalid.user1@com' for rule 2 in tool 'spades' is in an invalid format! Ignoring email."),498 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No valid user emails were specified for rule 2 in tool 'spades'! Ignoring rule."),499 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')500 )501 @log_capture()502 def test_return_bool_for_empty_users(self, l):503 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest141, job_conf_path=job_conf_path, test=True, return_bool=True))504 l.check_present(505 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry 'None' in users for rule 2 in tool 'spades' is in an invalid format!"),506 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry 'None' in users for rule 2 in tool 'spades' is in an invalid format!"),507 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No valid user emails were specified for rule 2 in tool 'spades'!")508 )509 @log_capture()510 def test_return_rule_for_empty_users(self, l):511 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest141, job_conf_path=job_conf_path, test=True), yt.iv141dict)512 l.check_present(513 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),514 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry 'None' in users for rule 2 in tool 'spades' is in an invalid format! Ignoring entry."),515 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Entry 'None' in users for rule 2 in tool 'spades' is in an invalid format! Ignoring entry."),516 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No valid user emails were specified for rule 2 in tool 'spades'! Ignoring rule."),517 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')518 )519 @log_capture()520 def test_return_bool_for_bad_num_input_datasets_bounds(self, l):521 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest142, job_conf_path=job_conf_path, test=True, return_bool=True))522 l.check_present(523 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Error: lower_bound is set to Infinity, but must be lower than upper_bound!"),524 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "lower_bound exceeds upper_bound for rule 1 in 'smalt'.")525 )526 @log_capture()527 def test_return_rule_for_bad_num_input_datasets_bound(self, l):528 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest142, job_conf_path=job_conf_path, test=True), yt.iv142dict)529 l.check_present(530 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),531 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Error: lower_bound is set to Infinity, but must be lower than upper_bound! Setting lower_bound to 0!"),532 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')533 )534 @log_capture()535 def test_return_bool_for_worse_num_input_datasets_bounds(self, l):536 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest143, job_conf_path=job_conf_path, test=True, return_bool=True))537 l.check_present(538 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Error: lower_bound is set to Infinity, but must be lower than upper_bound!")539 )540 @log_capture()541 def test_return_rule_for_worse_num_input_datasets_bound(self, l):542 self.assertEqual(dt.parse_yaml(path=yt.ivYMLTest143, job_conf_path=job_conf_path, test=True), yt.iv143dict)543 l.check_present(544 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),545 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Error: lower_bound is set to Infinity, but must be lower than upper_bound! Setting lower_bound to 0!"),546 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')547 )548 @log_capture()549 def test_tool_without_low_default_destination(self, l):550 dt.parse_yaml(path=yt.ivYMLTest146, job_conf_path=job_conf_path, test=True)551 l.check_present(552 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),553 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),554 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid priority 'low' for rule 1 in 'smalt'. Ignoring..."),555 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')556 )557 @log_capture()558 def test_tool_with_invalid_priority_destination(self, l):559 dt.parse_yaml(path=yt.ivYMLTest147, job_conf_path=job_conf_path, test=True)560 l.check_present(561 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),562 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),563 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid priority 'mine' for rule 1 in 'smalt'. Ignoring..."),564 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')565 )566 @log_capture()567 def test_not_all_priorities_in_tool(self, l):568 dt.parse_yaml(path=yt.ivYMLTest149, job_conf_path=job_conf_path, test=True)569 l.check_present(570 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),571 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),572 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')573 )574 @log_capture()575 def test_rule_destination_not_in_job_conf(self, l):576 dt.parse_yaml(path=yt.ivYMLTest150, job_conf_path=job_conf_path, test=True)577 l.check_present(578 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),579 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),580 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blegh', rule 1: 'fake_destination' does not exist in job configuration. Ignoring..."),581 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')582 )583 @log_capture()584 def test_tool_default_destination_not_in_job_conf_with_no_rules(self, l):585 dt.parse_yaml(path=yt.ivYMLTest151, job_conf_path=job_conf_path, test=True)586 l.check_present(587 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),588 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),589 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),590 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'blah' does not have rules nor a default_destination!"),591 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')592 )593 @log_capture()594 def test_default_destination_not_in_job_conf(self, l):595 dt.parse_yaml(path=yt.ivYMLTest152, job_conf_path=job_conf_path, test=True)596 l.check_present(597 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),598 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'no_such_dest' does not appear in the job configuration."),599 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),600 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')601 )602 @log_capture()603 def test_rule_destination_without_priority_not_in_job_conf(self, l):604 dt.parse_yaml(path=yt.ivYMLTest153, job_conf_path=job_conf_path, test=True)605 l.check_present(606 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),607 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),608 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blegh', rule 1: 'fake_destination' does not exist in job configuration. Ignoring..."),609 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')610 )611 @log_capture()612 def test_tool_default_destination_without_priority_not_in_job_conf_with_no_rules(self, l):613 dt.parse_yaml(path=yt.ivYMLTest154, job_conf_path=job_conf_path, test=True)614 l.check_present(615 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),616 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),617 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),618 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'blah' does not have rules nor a default_destination!"),619 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')620 )621 @log_capture()622 def test_default_destination_without_priority_not_in_job_conf(self, l):623 dt.parse_yaml(path=yt.ivYMLTest155, job_conf_path=job_conf_path, test=True)624 l.check_present(625 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),626 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'no_such_dest' does not appear in the job configuration."),627 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')628 )629 @log_capture()630 def test_tool_rule_priority_does_not_exist(self, l):631 dt.parse_yaml(path=yt.ivYMLTest156, job_conf_path=job_conf_path, test=True)632 l.check_present(633 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),634 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),635 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid priority 'notAPriority' for rule 1 in 'aTool'. Ignoring..."),636 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')637 )638 @log_capture()639 def test_tool_default_destination_priority_does_not_exist(self, l):640 dt.parse_yaml(path=yt.ivYMLTest157, job_conf_path=job_conf_path, test=True)641 l.check_present(642 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),643 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),644 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid default destination priority 'notAPriority' for 'aTool'."),645 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')646 )647 @log_capture()648 def test_tool_default_destination_not_in_job_conf(self, l):649 dt.parse_yaml(path=yt.ivYMLTest158, job_conf_path=job_conf_path, test=True)650 l.check_present(651 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),652 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),653 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),654 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')655 )656 @log_capture()657 def test_tool_default_destination_without_priority_not_in_job_conf(self, l):658 dt.parse_yaml(path=yt.ivYMLTest159, job_conf_path=job_conf_path, test=True)659 l.check_present(660 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),661 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),662 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')663 )664 @log_capture()665 def test_empty_priority_dict(self, l):666 dt.parse_yaml(path=yt.ivYMLTest163, job_conf_path=job_conf_path, test=True)667 l.check_present(668 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),669 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No global default destinations specified in config!"),670 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')671 )672 @log_capture()673 def test_default_dest_is_string_but_priorities_used_in_rule(self, l):674 dt.parse_yaml(path=yt.ivYMLTest161, job_conf_path=job_conf_path, test=True)675 l.check_present(676 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),677 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid priority 'med' for rule 1 in 'blah'. Ignoring..."),678 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')679 )680 @log_capture()681 def test_default_dest_is_string_but_priorities_used_in_tool_default_dest(self, l):682 dt.parse_yaml(path=yt.ivYMLTest162, job_conf_path=job_conf_path, test=True)683 l.check_present(684 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),685 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Invalid default destination priority 'med' for 'blah'."),686 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')687 )688 @log_capture()689 def test_typo_in_str_default_dest(self, l):690 dt.parse_yaml(path=yt.ivYMLTest164, job_conf_path=job_conf_path, test=True)691 l.check_present(692 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),693 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'cluster-kow' does not appear in the job configuration. Did you mean 'cluster_low'?"),694 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')695 )696 @log_capture()697 def test_typo_in_dict_default_dest(self, l):698 dt.parse_yaml(path=yt.ivYMLTest165, job_conf_path=job_conf_path, test=True)699 l.check_present(700 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),701 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'cluster_kow' does not appear in the job configuration. Did you mean 'cluster_low'?"),702 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')703 )704 @log_capture()705 def test_typo_in_dict_tool_default_dest(self, l):706 dt.parse_yaml(path=yt.ivYMLTest166, job_conf_path=job_conf_path, test=True)707 l.check_present(708 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),709 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'cluster_defaut' does not appear in the job configuration. Did you mean 'cluster_default'?"),710 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')711 )712 @log_capture()713 def test_typo_in_str_tool_default_dest(self, l):714 dt.parse_yaml(path=yt.ivYMLTest167, job_conf_path=job_conf_path, test=True)715 l.check_present(716 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),717 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'Destination_3_med' does not appear in the job configuration. Did you mean 'Destination3_med'?"),718 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')719 )720 @log_capture()721 def test_typo_in_str_tool_rule_dest(self, l):722 dt.parse_yaml(path=yt.ivYMLTest168, job_conf_path=job_conf_path, test=True)723 l.check_present(724 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),725 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blah', rule 1: 'thig' does not exist in job configuration. Did you mean 'things'? Ignoring..."),726 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')727 )728 @log_capture()729 def test_typo_in_dict_tool_rule_dest(self, l):730 dt.parse_yaml(path=yt.ivYMLTest169, job_conf_path=job_conf_path, test=True)731 l.check_present(732 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),733 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blah', rule 1: 'even_lamerr_cluster' does not exist in job configuration. Did you mean 'even_lamer_cluster'? Ignoring..."),734 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')735 )736 @log_capture()737 def test_typo_in_case(self, l):738 dt.parse_yaml(path=yt.ivYMLTest170, job_conf_path=job_conf_path, test=True)739 l.check_present(740 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),741 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'destinationf' does not appear in the job configuration. Did you mean 'DestinationF'?"),742 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')743 )744 @log_capture()745 def test_invalid_verbose_value(self, l):746 dt.parse_yaml(path=yt.ivYMLTest171, job_conf_path=job_conf_path, test=True)747 l.check_present(748 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Verbose value 'notavalue' is not True or False! Falling back to verbose..."),749 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),750 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')751 )752 @log_capture()753 def test_invalid_default_dest_valid_tool_default_dest_bool(self, l):754 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest172, job_conf_path=job_conf_path, test=True, return_bool=True))755 l.check_present(756 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'fake_destination' does not appear in the job configuration."),757 )758 @log_capture()759 def test_valid_default_dest_invalid_tool_default_dest_bool(self, l):760 self.assertFalse(dt.parse_yaml(path=yt.ivYMLTest173, job_conf_path=job_conf_path, test=True, return_bool=True))761 l.check_present(762 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'fake_destination' does not appear in the job configuration."),763 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Tool 'blah' does not have rules nor a default_destination!"),764 )765# ================================Valid yaml files==============================766 @log_capture()767 def test_parse_valid_yml(self, l):768 self.assertEqual(dt.parse_yaml(yt.vYMLTest1, job_conf_path=job_conf_path, test=True), yt.vdictTest1_yml)769 self.assertEqual(dt.parse_yaml(yt.vYMLTest2, job_conf_path=job_conf_path, test=True), yt.vdictTest2_yml)770 self.assertEqual(dt.parse_yaml(yt.vYMLTest3, job_conf_path=job_conf_path, test=True), yt.vdictTest3_yml)771 self.assertTrue(dt.parse_yaml(yt.vYMLTest4, job_conf_path=job_conf_path, test=True, return_bool=True))772 self.assertEqual(dt.parse_yaml(yt.vYMLTest4, job_conf_path=job_conf_path, test=True), yt.vdictTest4_yml)773 self.assertTrue(dt.parse_yaml(yt.vYMLTest5, job_conf_path=job_conf_path, test=True, return_bool=True))774 self.assertEqual(dt.parse_yaml(yt.vYMLTest5, job_conf_path=job_conf_path, test=True), yt.vdictTest5_yml)775 self.assertTrue(dt.parse_yaml(yt.vYMLTest6, job_conf_path=job_conf_path, test=True, return_bool=True))776 self.assertEqual(dt.parse_yaml(yt.vYMLTest6, job_conf_path=job_conf_path, test=True), yt.vdictTest6_yml)777 self.assertTrue(dt.parse_yaml(yt.vYMLTest7, job_conf_path=job_conf_path, test=True, return_bool=True))778 self.assertEqual(dt.parse_yaml(yt.vYMLTest7, job_conf_path=job_conf_path, test=True), yt.vdictTest7_yml)779 self.assertTrue(dt.parse_yaml(yt.vYMLTest160, job_conf_path=job_conf_path, test=True, return_bool=True))780 self.assertEqual(dt.parse_yaml(yt.vYMLTest160, job_conf_path=job_conf_path, test=True), yt.vdictTest160_yml)781 self.assertTrue(dt.parse_yaml(yt.vYMLTest164, job_conf_path=job_conf_path, test=True, return_bool=True))782 self.assertEqual(dt.parse_yaml(yt.vYMLTest164, job_conf_path=job_conf_path, test=True), yt.vdictTest164_yml)783 l.check_present(784 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),785 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),786 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),787 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),788 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),789 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),790 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),791 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),792 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),793 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),794 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),795 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.'),796 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "No default_priority section found in config. Setting 'med' as default priority."),797 ('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!