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

atlanticwave-sdx / datamodel / 5766094714

pending completion
5766094714

push

github

web-flow
Merge pull request #88 from atlanticwave-sdx/24.vlan_range

Parsing L2VPN VLAN ranges

212 of 418 branches covered (50.72%)

Branch coverage included in aggregate %.

42 of 48 new or added lines in 2 files covered. (87.5%)

1002 of 1256 relevant lines covered (79.78%)

2.38 hits per line

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

82.61
/src/sdx/datamodel/parsing/exceptions.py
1
class DataModelException(Exception):
3✔
2
    """
3✔
3
    Base exception for topology data model functions.
4
    """
5

6
    pass
3✔
7

8

9
class MissingAttributeException(DataModelException):
3✔
10
    """
3✔
11
    A required attribute was missing when parsing a model element.
12
    """
13

14
    def __init__(self, data, attribute):
3✔
15
        """
16
        :param data: The data that is being parsed.
17
        :param attribute: The attribute that is required to be present.
18
        """
19
        self.data = data
3✔
20
        self.attribute = attribute
3✔
21

22
    def __str__(self):
3✔
23
        return (
3✔
24
            f"Missing required attribute '{self.attribute}' "
25
            f"while parsing <{self.data}>"
26
        )
27

28

29
class InvalidVlanRangeException(DataModelException):
3✔
30
    """
3✔
31
    VLAN range is of an invalid format.
32

33
    VLAN range is expected to be in the format [[start, end], [start,
34
    end]], with start and end being numers, and start < end.
35
    """
36

37
    def __init__(self, message: str):
3✔
38
        self._message = message
3✔
39

40
    def __str__(self):
3✔
NEW
41
        return self._message
×
42

43

44
class GraphNotConnectedException(DataModelException):
3✔
45
    """
3✔
46
    The topology is not connected.
47
    """
48

49
    def __init__(self, graph, connectivity):
3✔
50
        """
51
        :param graph: The graph that is being checked.
52
        :param connectivity: Connectivity status for the graph.
53
        """
54
        self.graph = graph
×
55
        self.connectivity = connectivity
×
56

57
    def __str__(self):
3✔
58
        return f"Graph <{self.graph}> is not connected: {self.connectivity}"
×
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