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

zopefoundation / zope.component / 3827624917

pending completion
3827624917

push

github

GitHub
Update src/zope/component/tests/test_interface.py

467 of 489 branches covered (95.5%)

Branch coverage included in aggregate %.

4620 of 4625 relevant lines covered (99.89%)

1.0 hits per line

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

95.83
/src/zope/component/testfiles/components.py
1
##############################################################################
2
#
3
# Copyright (c) 2002 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""Components for testing
1✔
15
"""
16
from zope.interface import Interface
1✔
17
from zope.interface import Attribute
1✔
18
from zope.interface import implementer
1✔
19
from zope.component import adapter
1✔
20
from zope.component import named
1✔
21

22
class IAppb(Interface):
1✔
23
    a = Attribute('test attribute')
1✔
24
    def f(): "test func"
1!
25

26
class IApp(IAppb):
1✔
27
    pass
1✔
28

29
class IApp2(IAppb):
1✔
30
    pass
1✔
31

32
class IApp3(IAppb):
1✔
33
    pass
1✔
34

35
class IContent(Interface): pass
1✔
36

37
@implementer(IContent)
1✔
38
class Content(object):
1✔
39
    pass
1✔
40

41
@adapter(IContent)
1✔
42
@implementer(IApp)
1✔
43
class Comp(object):
1✔
44

45
    def __init__(self, *args):
1✔
46
        # Ignore arguments passed to constructor
47
        pass
1✔
48

49
    a = 1
1✔
50
    def f(): pass
1!
51

52
class Comp2(object):
1✔
53
    def __init__(self, context):
1✔
54
        self.context = context
1✔
55

56
@adapter(IContent)
1✔
57
@implementer(IApp)
1✔
58
@named('app')
1✔
59
class Comp4(object):
1✔
60
    def __init__(self, context=None):
1✔
61
        self.context = context
1✔
62

63
comp = Comp()
1✔
64
comp4 = Comp4()
1✔
65

66
content = Content()
1✔
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