PageRenderTime 24ms CodeModel.GetById 19ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/logilab-astng-0.23.1/test/data2/clientmodule_test.py

#
Python | 51 lines | 21 code | 8 blank | 22 comment | 0 complexity | 9ac1ad9dd1dac7a988f79ceb2f99a2ac MD5 | raw file
 1# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 2# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 3# copyright 2003-2010 Sylvain Thenault, all rights reserved.
 4# contact mailto:thenault@gmail.com
 5#
 6# This file is part of logilab-astng.
 7#
 8# logilab-astng is free software: you can redistribute it and/or modify it
 9# under the terms of the GNU Lesser General Public License as published by the
10# Free Software Foundation, either version 2.1 of the License, or (at your
11# option) any later version.
12#
13# logilab-astng is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
16# for more details.
17#
18# You should have received a copy of the GNU Lesser General Public License along
19# with logilab-astng. If not, see <http://www.gnu.org/licenses/>.
20""" docstring for file clientmodule.py """
21from data2.suppliermodule_test import Interface as IFace, DoNothing
22
23class Toto: pass
24
25class Ancestor:
26    """ Ancestor method """
27    __implements__ = (IFace,)
28    
29    def __init__(self, value):
30        local_variable = 0
31        self.attr = 'this method shouldn\'t have a docstring'
32        self.__value = value
33
34    def get_value(self):
35        """ nice docstring ;-) """
36        return self.__value
37
38    def set_value(self, value):
39        self.__value = value
40        return 'this method shouldn\'t have a docstring'    
41
42class Specialization(Ancestor):
43    TYPE = 'final class'
44    top = 'class'
45    
46    def __init__(self, value, _id):
47        Ancestor.__init__(self, value)
48        self._id = _id
49        self.relation = DoNothing()
50        self.toto = Toto()
51