• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / relman-auto-nag / #4077

pending completion
#4077

push

coveralls-python

suhaibmujahid
Merge remote-tracking branch 'upstream/master' into wiki-missed

549 of 3109 branches covered (17.66%)

615 of 615 new or added lines in 27 files covered. (100.0%)

1773 of 8016 relevant lines covered (22.12%)

0.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/auto_nag/severity.py
1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
# You can obtain one at http://mozilla.org/MPL/2.0/.
4

5

6
class Severity:
1✔
7
    """Severity Class
8

9
    This class is to be used to compare bug severity values.
10
    """
11

12
    SEVERITY_LEVELS = {"S1", "S2", "S3", "S4"}
1✔
13
    ACCEPTED_VALUES = SEVERITY_LEVELS | {"--", "N/A"}
1✔
14

15
    def __init__(self, severity):
1✔
16
        """Constructor
17

18
        prams:
19
            severity: the severity of the bug
20
        """
21
        assert severity in self.ACCEPTED_VALUES, "Invalid severity"
1✔
22
        self._value = severity
1✔
23

24
    def __bool__(self) -> bool:
1✔
25
        return self._value not in {"--", "N/A"}
1✔
26

27
    def __eq__(self, other) -> bool:
1✔
28
        return self._value == other._value or (not self and not other)
1✔
29

30
    def __lt__(self, other) -> bool:
1✔
31
        if not self and other:
1✔
32
            return True
1✔
33

34
        if self and not other or self == other:
1✔
35
            return False
1✔
36

37
        return self._value > other._value
1✔
38

39
    def __str__(self) -> str:
1✔
40
        return self._value
×
41

42
    def __repr__(self) -> str:
1✔
43
        return f"<Severity( {self._value} )>"
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc