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

mozilla / relman-auto-nag / #4153

pending completion
#4153

push

coveralls-python

suhaibmujahid
[duplicate_copy_metadata] Copy WebCompat Priority flag

553 of 3089 branches covered (17.9%)

34 of 34 new or added lines in 2 files covered. (100.0%)

1797 of 7986 relevant lines covered (22.5%)

0.23 hits per line

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

92.59
/auto_nag/webcompat_priority.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 WebcompatPriority:
1✔
7
    """Webcompat priority Class
8

9
    This class is to be used to compare webcompat priority values.
10
    """
11

12
    PRIORITY_LEVELS = {"P1", "P2", "P3"}
1✔
13
    TRIAGE_REQUIRED_VALUES = {"?", "revisit"}
1✔
14
    EMPTY_VALUES = {"--", "-"}
1✔
15
    NOT_EMPTY_VALUES = PRIORITY_LEVELS | TRIAGE_REQUIRED_VALUES
1✔
16
    ACCEPTED_VALUES = NOT_EMPTY_VALUES | EMPTY_VALUES
1✔
17

18
    def __init__(self, priority):
1✔
19
        """Constructor
20

21
        prams:
22
            severity: the severity of the bug
23
        """
24
        assert priority in self.ACCEPTED_VALUES, "Invalid priority"
1✔
25
        self._value = priority
1✔
26

27
    def __bool__(self) -> bool:
1✔
28
        return self._value in self.PRIORITY_LEVELS
1✔
29

30
    def __eq__(self, other) -> bool:
1✔
31
        return self._value == other._value or (not self and not other)
1✔
32

33
    def __lt__(self, other) -> bool:
1✔
34
        if not self and other:
1✔
35
            return True
1✔
36

37
        if self and not other or self == other:
1✔
38
            return False
1✔
39

40
        return self._value > other._value
1✔
41

42
    def __str__(self) -> str:
1✔
43
        return self._value
×
44

45
    def __repr__(self) -> str:
1✔
46
        return f"<WebcompatPriority( {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