summaryrefslogtreecommitdiff
path: root/test/input/func_interfaces.py
blob: 9756183c004091acfc8500bf3d8fbb7d5b4774c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# pylint:disable=R0201
"""docstring"""
__revision__ = ''

class Interface(object):
    """base class for interfaces"""

class IMachin(Interface):
    """docstring"""
    def truc(self):
        """docstring"""

    def troc(self, argument):
        """docstring"""

class Correct1(object):
    """docstring"""
    __implements__ = IMachin

    def __init__(self):
        pass

    def truc(self):
        """docstring"""
        pass

    def troc(self, argument):
        """docstring"""
        pass

class Correct2(object):
    """docstring"""
    __implements__ = (IMachin,)

    def __init__(self):
        pass

    def truc(self):
        """docstring"""
        pass

    def troc(self, argument):
        """docstring"""
        print argument

class MissingMethod(object):
    """docstring"""
    __implements__ = IMachin,

    def __init__(self):
        pass

    def troc(self, argument):
        """docstring"""
        print argument

    def other(self):
        """docstring"""

class BadArgument(object):
    """docstring"""
    __implements__ = (IMachin,)

    def __init__(self):
        pass

    def truc(self):
        """docstring"""
        pass

    def troc(self):
        """docstring"""
        pass

class InterfaceCantBeFound(object):
    """docstring"""
    __implements__ = undefined

    def __init__(self):
        """only to make pylint happier"""

    def please(self):
        """public method 1/2"""

    def besilent(self):
        """public method 2/2"""

class InterfaceCanNowBeFound(object):
    """docstring"""
    __implements__ = BadArgument.__implements__ + Correct2.__implements__

    def __init__(self):
        """only to make pylint happier"""

    def please(self):
        """public method 1/2"""

    def besilent(self):
        """public method 2/2"""


class EmptyImplements(object):
    """no pb"""
    __implements__ = ()
    def __init__(self):
        """only to make pylint happier"""

    def please(self):
        """public method 1/2"""

    def besilent(self):
        """public method 2/2"""