• 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

93.33
/boa3/internal/model/type/classes/classinitmethoddefault.py
1
from boa3.internal import constants
2✔
2
from boa3.internal.model.identifiedsymbol import IdentifiedSymbol
2✔
3
from boa3.internal.model.method import Method
2✔
4
from boa3.internal.model.type.classes.userclass import UserClass
2✔
5
from boa3.internal.model.variable import Variable
2✔
6

7

8
class ClassInitMethod(IdentifiedSymbol, Method):
2✔
9
    def __init__(self, user_class: UserClass):
2✔
10
        self_var = Variable(user_class)
2✔
11
        args = {
2✔
12
            'self': self_var
13
        }
14
        base_init = None
2✔
15
        if len(user_class.bases) == 1:
2✔
16
            # TODO: change when class inheritance with multiple bases is implemented #2kq1gmc
17
            # use update to keep the original order
18
            base_init = user_class.bases[0].constructor_method()
2✔
19
            args.update(base_init.args)
2✔
20
            # but change the self type
21
            args['self'] = self_var
2✔
22

23
        Method.__init__(self, args=args, return_type=user_class)
2✔
24
        IdentifiedSymbol.__init__(self, identifier=constants.INIT_METHOD_ID)
2✔
25

26
        self.defined_by_entry = False
2✔
27
        self.is_init = True
2✔
28
        self.origin_class = user_class
2✔
29
        # __init__ method behave like class methods
30
        from boa3.internal.model.builtin.builtin import Builtin
2✔
31
        self.decorators.append(Builtin.ClassMethodDecorator)
2✔
32

33
        if base_init is not None:
2✔
34
            origin = self.origin if self.origin else self
2✔
35
            base_init.add_call_origin(origin)
2✔
36

37
    @property
2✔
38
    def _args_on_stack(self) -> int:
2✔
UNCOV
39
        return len(self.args)
×
40

41
    @property
2✔
42
    def _body(self) -> str | None:
2✔
UNCOV
43
        return None
×
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