Coverage for src/P4OO/Job.py: 0%

10 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-09-07 17:17 +0000

1###################################################################### 

2# Copyright (c)2012,2015,2024 David L. Armstrong. 

3# 

4# P4OO.Job.py 

5# 

6###################################################################### 

7 

8from dataclasses import dataclass, field 

9 

10from P4OO._SpecObj import _P4OOSpecObj 

11from P4OO._Set import _P4OOSet 

12 

13@dataclass(unsafe_hash=True) 

14class P4OOJob(_P4OOSpecObj): 

15 """ 

16 Perforce Job Spec Object 

17 

18 id Required: No 

19 

20 Forcible: Yes 

21 

22 Attributes: 

23 job (str): Name of the job 

24 user (P4OOUser): User that created the job spec 

25 description (str): Description field 

26 status (str): [`open`|`closed`|`suspended`] 

27 date (datetime): Time of last update to the spec 

28 

29 See Also: 

30 Perforce Helix Core Command Reference: 

31 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_job.html 

32 """ 

33 

34 # Subclasses must define SPECOBJ_TYPE 

35 _SPECOBJ_TYPE = 'job' 

36 

37@dataclass 

38class P4OOJobSet(_P4OOSet): 

39 """ `P4OOSet` of `P4OOJob` objects """ 

40 

41 def query(self, jobview: str=None, maxresults: int=None, 

42 files: str=None, longoutput: bool=None, 

43 **kwargs): 

44 """ 

45 Executes `p4 jobs` query 

46 

47 Args: 

48 jobview (str, optional): List only those jobs matching 

49 specified job view 

50 maxresults (int, optional): Return only the first [max] results 

51 files (P4OOFileSet | P4OOFile | str, optional): The set of file 

52 revisions to query 

53 longoutput (bool, optional): include the full changelist 

54 descriptions 

55 

56 Returns: 

57 (P4OOJobSet): `P4OOSet` of `P4OOJob` objects matching query 

58 parameters 

59 

60 See Also: 

61 Perforce Helix Core Command Reference: 

62 https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_jobs.html 

63 """ 

64 

65 return self._query(setObjType='jobs', jobview=jobview, 

66 maxresults=maxresults, files=files, 

67 longoutput=longoutput, **kwargs)