Coverage for lode / models / model.py: 65%

34 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-03-25 15:05 +0000

1from .resource import Resource 

2 

3class Model(Resource): 

4 

5 def __init__(self, **kwargs): 

6 super().__init__(**kwargs) 

7 self.has_version = [] # 0..* 

8 self.is_backward_compatible_with = [] # 0..*  

9 self.imports = [] # 0..* 

10 self.is_incompatible_with = [] # 0..* 

11 self.has_top_concept = [] # 0..1 

12 self.has_prior_version = None # 0..1 

13 

14 def get_has_version(self): 

15 """Restituisce la lista has_version""" 

16 return list(self.has_version) 

17 

18 def set_has_version(self, model): 

19 """Aggiunge un Model a has_version """ 

20 self.has_version.append(model) 

21 

22 def get_is_backward_compatible_with(self): 

23 """Restituisce la lista is_backward_compatible_with""" 

24 return list(self.is_backward_compatible_with) 

25 

26 def set_is_backward_compatible_with(self, model): 

27 """Aggiunge un Model a is_backward_compatible_with""" 

28 self.is_backward_compatible_with.append(model) 

29 

30 def get_imports(self): 

31 """Restituisce la lista imports""" 

32 return list(self.imports) 

33 

34 def set_imports(self, model): 

35 """Aggiunge un Model a imports""" 

36 self.imports.append(model) 

37 

38 def get_is_incompatible_with(self): 

39 """Restituisce la lista is_incompatible_with""" 

40 return list(self.is_incompatible_with) 

41 

42 def set_is_incompatible_with(self, model): 

43 """Aggiunge un Model a is_incompatible_with""" 

44 self.is_incompatible_with.append(model) 

45 

46 def get_has_top_concept(self): 

47 """Restituisce la lista has_top_concept""" 

48 return self.has_top_concept 

49 

50 def set_has_top_concept(self, concept): 

51 """Aggiunge un Concept a has_top_concept""" 

52 self.has_top_concept = concept 

53 

54 def get_has_prior_version(self): 

55 """Restituisce la lista has_prior_version""" 

56 return self.has_prior_version 

57 

58 def set_has_prior_version(self, model): 

59 """Aggiunge un Model a has_prior_version""" 

60 self.has_prior_version = model