Пример #1
0
 def _extract_task_instance_and_path(context, file_path):
     key = file_path.split(':', 1)
     try:
         if (len(key) == 1):
             return (None, key[0])  # No jobkey specified
         return (parse_task_instance_key(key[0]), key[1])
     except ArgumentTypeError as e:
         raise context.CommandError(EXIT_INVALID_PARAMETER, str(e))
Пример #2
0
 def _extract_task_instance_and_path(context, file_path):
   key = file_path.split(':', 1)
   try:
     if (len(key) == 1):
       return (None, key[0])  # No jobkey specified
     return (parse_task_instance_key(key[0]), key[1])
   except ArgumentTypeError as e:
     raise context.CommandError(EXIT_INVALID_PARAMETER, str(e))
Пример #3
0
 def test_parse_task_instance_key_fails_on_range(self):
     with pytest.raises(ArgumentTypeError):
         parse_task_instance_key("cluster/role/env/name/0-5")
Пример #4
0
 def test_parse_task_instance_key_missing_instance(self):
     with pytest.raises(ArgumentTypeError):
         parse_task_instance_key("cluster/role/env/name")
Пример #5
0
 def test_parse_task_instance_key_fails_on_range(self):
     with pytest.raises(ArgumentTypeError):
         parse_task_instance_key("cluster/role/env/name/0-5")
Пример #6
0
 def test_parse_task_instance_key_missing_instance(self):
     with pytest.raises(ArgumentTypeError):
         parse_task_instance_key("cluster/role/env/name")