File: test_pbspro_template.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (27 lines) | stat: -rw-r--r-- 772 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import random
from unittest import mock

import pytest

from parsl.providers import PBSProProvider


@pytest.mark.local
def test_submit_script_basic(tmp_path):
    """Test slurm resources table"""

    provider = PBSProProvider(
        queue="debug"
    )
    provider.script_dir = tmp_path
    job_id = str(random.randint(55000, 59000))
    provider.execute_wait = mock.Mock(spec=PBSProProvider.execute_wait)
    provider.execute_wait.return_value = (0, job_id, "")
    result_job_id = provider.submit("test", tasks_per_node=1)
    assert job_id == result_job_id
    provider.execute_wait.assert_called()
    assert job_id in provider.resources

    job_info = provider.resources[job_id]
    assert "job_stdout_path" in job_info
    assert "job_stderr_path" in job_info