:param protocolTreeNode: ProtocolTreeNode :return: bool
(self, protocolTreeNode)
| 19 | assert type(self.children) is list, "Children must be a list, got %s" % type(self.children) |
| 20 | |
| 21 | def __eq__(self, protocolTreeNode): |
| 22 | """ |
| 23 | :param protocolTreeNode: ProtocolTreeNode |
| 24 | :return: bool |
| 25 | """ |
| 26 | # |
| 27 | if protocolTreeNode.__class__ == ProtocolTreeNode\ |
| 28 | and self.tag == protocolTreeNode.tag\ |
| 29 | and self.data == protocolTreeNode.data\ |
| 30 | and self.attributes == protocolTreeNode.attributes\ |
| 31 | and len(self.getAllChildren()) == len(protocolTreeNode.getAllChildren()): |
| 32 | found = False |
| 33 | for c in self.getAllChildren(): |
| 34 | for c2 in protocolTreeNode.getAllChildren(): |
| 35 | if c == c2: |
| 36 | found = True |
| 37 | break |
| 38 | if not found: |
| 39 | return False |
| 40 | |
| 41 | found = False |
| 42 | for c in protocolTreeNode.getAllChildren(): |
| 43 | for c2 in self.getAllChildren(): |
| 44 | if c == c2: |
| 45 | found = True |
| 46 | break |
| 47 | if not found: |
| 48 | return False |
| 49 | |
| 50 | return True |
| 51 | |
| 52 | return False |
| 53 | |
| 54 | def __hash__(self): |
| 55 | return hash(self.tag) ^ hash(tuple(self.attributes.items())) ^ hash(self.data) |
nothing calls this directly
no test coverage detected