def test_parsec_validator_invalid_key_with_many_invalid_values(self): for spec, cfg, msg in get_parsec_validator_invalid_values(): parsec_validator = ParsecValidator() if msg is not None: with self.assertRaises(IllegalValueError) as cm: parsec_validator.validate(cfg, spec) self.assertEqual(msg, str(cm.exception)) else: # cylc.flow.parsec_validator.validate(cfg, spec) # let's use the alias `parsec_validate` here parsec_validate(cfg, spec) # TBD assertIsNotNone when 2.6+ self.assertTrue(parsec_validator is not None)
def test_parsec_validator_invalid_key_with_many_invalid_values( validator_invalid_values): for spec, cfg, msg in validator_invalid_values: parsec_validator = ParsecValidator() if msg is not None: with pytest.raises(IllegalValueError) as cm: parsec_validator.validate(cfg, spec) assert msg == str(cm.value) else: # cylc.flow.parsec_validator.validate(cfg, spec) # let's use the alias `parsec_validate` here parsec_validate(cfg, spec) # TBD assertIsNotNone when 2.6+ assert parsec_validator is not None