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

CityOfZion / neo3-boa / 0aff654d-b027-49a1-9d97-558d9a2a52ff

05 Mar 2024 04:57PM UTC coverage: 91.985% (-0.1%) from 92.106%
0aff654d-b027-49a1-9d97-558d9a2a52ff

push

circleci

web-flow
Merge pull request #1215 from CityOfZion/CU-86drpndkk

CU-86drpndkk - Refactor test_interop/test_blockchain.py to use BoaTestConstructor

1 of 1 new or added line in 1 file covered. (100.0%)

658 existing lines in 143 files now uncovered.

20635 of 22433 relevant lines covered (91.99%)

1.84 hits per line

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

91.3
/boa3/internal/model/operation/binary/relational/objectequality.py
1
from boa3.internal.model.operation.binary.binaryoperation import BinaryOperation
2✔
2
from boa3.internal.model.operation.operator import Operator
2✔
3
from boa3.internal.model.type.type import IType, Type
2✔
4
from boa3.internal.neo.vm.opcode.Opcode import Opcode
2✔
5

6

7
class ObjectEquality(BinaryOperation):
2✔
8
    """
9
    A class used to represent a equality comparison
10

11
    :ivar operator: the operator of the operation. Inherited from :class:`IOperation`
12
    :ivar left: the left operand type. Inherited from :class:`BinaryOperation`
13
    :ivar right: the left operand type. Inherited from :class:`BinaryOperation`
14
    :ivar result: the result type of the operation.  Inherited from :class:`IOperation`
15
    """
16
    _valid_types: list[IType] = [Type.str, Type.bytes, Type.int, Type.bool]
2✔
17

18
    def __init__(self, left: IType = Type.str, right: IType = None):
2✔
19
        self.operator: Operator = Operator.Eq
2✔
20
        super().__init__(left, right)
2✔
21

22
    def validate_type(self, *types: IType) -> bool:
2✔
23
        if len(types) != self.number_of_operands:
2✔
UNCOV
24
            return False
×
25
        left: IType = types[0]
2✔
26
        right: IType = types[1]
2✔
27

28
        return self._is_valid_type(left) and self._is_valid_type(right)
2✔
29

30
    def _is_valid_type(self, tpe: IType) -> bool:
2✔
31
        return any(valid.is_type_of(tpe) for valid in self._valid_types)
2✔
32

33
    def _get_result(self, left: IType, right: IType) -> IType:
2✔
34
        if self.validate_type(left, right):
2✔
35
            return Type.bool
2✔
36
        else:
UNCOV
37
            return Type.none
×
38

39
    def generate_internal_opcodes(self, code_generator):
2✔
40
        code_generator.insert_opcode(Opcode.EQUAL)
2✔
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

© 2026 Coveralls, Inc