Changeset a87154a in rtems-central for rtemsqual/applconfig.py


Ignore:
Timestamp:
Apr 17, 2020, 5:15:26 AM (14 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
fd03a17
Parents:
eb54ec9
Message:

applconfig: Add unit tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsqual/applconfig.py

    reb54ec9 ra87154a  
    105105
    106106
     107def _generate_item_set(lines: List[str], constraint: Dict[str, Any]) -> None:
     108    if "set" in constraint:
     109        value_set = constraint["set"]
     110        lines.append("")
     111        lines.append(f"* It shall be an element of {value_set}.")
     112
     113
    107114def _generate_item_custom(lines: List[str], constraint: Dict[str,
    108115                                                             Any]) -> None:
     
    146153                _start_constraint_list(lines)
    147154                _generate_item_custom(lines, constraint)
    148         else:
    149             raise ValueError
    150155    elif count == 2 and "min" in constraint and "max" in constraint:
    151156        minimum = constraint["min"]
     
    158163        _generate_item_min(lines, constraint)
    159164        _generate_item_max(lines, constraint)
     165        _generate_item_set(lines, constraint)
    160166        _generate_item_custom(lines, constraint)
    161167    content.add_definition_item("VALUE CONSTRAINTS:", lines)
Note: See TracChangeset for help on using the changeset viewer.