test/unittest_cwconfig.py
author Rémi Cardona <remi.cardona@logilab.fr>
Mon, 21 Sep 2015 18:04:22 +0200
changeset 10722 1d0b5aef7523
parent 10239 495efb844048
child 10922 7d01c8c675a0
permissions -rw-r--r--
[tests] Stop counting pickle bytes in ResultSet tests Between python 2's pickle and cPickle implementations, the various protocol versions added in python 3, the length of the pickled string is completely unpredictable. Instead, do a simple round trip and test a few attributes.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8537
e30d0a7f0087 [config] turn internal configuration methods building appobjects search path into normal method rather than class method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7791
diff changeset
     1
# copyright 2003-2012 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     2
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     3
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     4
# This file is part of CubicWeb.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     5
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     6
# CubicWeb is free software: you can redistribute it and/or modify it under the
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     7
# terms of the GNU Lesser General Public License as published by the Free
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     8
# Software Foundation, either version 2.1 of the License, or (at your option)
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
     9
# any later version.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    10
#
5424
8ecbcbff9777 replace logilab-common by CubicWeb in disclaimer
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5421
diff changeset
    11
# CubicWeb is distributed in the hope that it will be useful, but WITHOUT
5421
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    13
# FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    14
# details.
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    15
#
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    16
# You should have received a copy of the GNU Lesser General Public License along
8167de96c523 proper licensing information (LGPL-2.1). Hope I get it right this time.
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    17
# with CubicWeb.  If not, see <http://www.gnu.org/licenses/>.
6314
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    18
"""cubicweb.cwconfig unit tests"""
1977
606923dff11b big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1640
diff changeset
    19
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
    20
import sys
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    21
import os
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    22
import tempfile
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
    23
from os.path import dirname, join, abspath
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    24
4691
ae468fae9965 [test] fix test inter-dependancies pb. Pytest ok in each individual test dir, though not yet for whole cubicweb, but for different reasons
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4681
diff changeset
    25
from logilab.common.modutils import cleanup_sys_modules
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    26
from logilab.common.testlib import (TestCase, unittest_main,
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    27
                                    with_tempdir)
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    28
from logilab.common.changelog import Version
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    29
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    30
from cubicweb.devtools import ApptestConfiguration
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    31
from cubicweb.cwconfig import _find_prefix
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    32
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    33
def unabsolutize(path):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    34
    parts = path.split(os.sep)
515
92d95b86263e search in reverted order else in case of installed cubes (eg in cubicweb/cubes) we do not remove all expected parts
sylvain.thenault@logilab.fr
parents: 13
diff changeset
    35
    for i, part in reversed(tuple(enumerate(parts))):
1341
9502d02630bf fix tests
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    36
        if part.startswith('cubicweb') or part == 'cubes':
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    37
            return '/'.join(parts[i+1:])
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    38
    raise Exception('duh? %s' % path)
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
    39
4681
5f72584ab1d7 [test] cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4490
diff changeset
    40
CUSTOM_CUBES_DIR = abspath(join(dirname(__file__), 'data', 'cubes'))
5f72584ab1d7 [test] cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4490
diff changeset
    41
5f72584ab1d7 [test] cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4490
diff changeset
    42
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    43
class CubicWebConfigurationTC(TestCase):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    44
    def setUp(self):
4691
ae468fae9965 [test] fix test inter-dependancies pb. Pytest ok in each individual test dir, though not yet for whole cubicweb, but for different reasons
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4681
diff changeset
    45
        cleanup_sys_modules([CUSTOM_CUBES_DIR, ApptestConfiguration.CUBES_DIR])
6631
26c303c3f1aa [test] make test independant from the working directory
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6412
diff changeset
    46
        self.config = ApptestConfiguration('data', apphome=self.datadir)
13
bae30087db21 fix unittests in cubicweb/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    47
        self.config._cubes = ('email', 'file')
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    48
1341
9502d02630bf fix tests
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    49
    def tearDown(self):
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
    50
        ApptestConfiguration.CUBES_PATH = []
1341
9502d02630bf fix tests
sylvain.thenault@logilab.fr
parents: 1263
diff changeset
    51
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    52
    def test_reorder_cubes(self):
6314
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    53
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    54
        self.config.adjust_sys_path()
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    55
        # forge depends on email and file and comment
13
bae30087db21 fix unittests in cubicweb/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    56
        # email depends on file
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    57
        self.assertEqual(self.config.reorder_cubes(['file', 'email', 'forge']),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    58
                          ('forge', 'email', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    59
        self.assertEqual(self.config.reorder_cubes(['email', 'file', 'forge']),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    60
                          ('forge', 'email', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    61
        self.assertEqual(self.config.reorder_cubes(['email', 'forge', 'file']),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    62
                          ('forge', 'email', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    63
        self.assertEqual(self.config.reorder_cubes(['file', 'forge', 'email']),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    64
                          ('forge', 'email', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    65
        self.assertEqual(self.config.reorder_cubes(['forge', 'file', 'email']),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    66
                          ('forge', 'email', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    67
        self.assertEqual(self.config.reorder_cubes(('forge', 'email', 'file')),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    68
                          ('forge', 'email', 'file'))
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
    69
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    70
    def test_reorder_cubes_recommends(self):
6314
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    71
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
    72
        self.config.adjust_sys_path()
13
bae30087db21 fix unittests in cubicweb/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    73
        from cubes.comment import __pkginfo__ as comment_pkginfo
5025
2826f5406201 deprecate __use__ and __recommend__
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5021
diff changeset
    74
        comment_pkginfo.__recommends_cubes__ = {'file': None}
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    75
        try:
13
bae30087db21 fix unittests in cubicweb/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    76
            # email recommends comment
bae30087db21 fix unittests in cubicweb/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 0
diff changeset
    77
            # comment recommends file
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    78
            self.assertEqual(self.config.reorder_cubes(('forge', 'email', 'file', 'comment')),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    79
                              ('forge', 'email', 'comment', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    80
            self.assertEqual(self.config.reorder_cubes(('forge', 'email', 'comment', 'file')),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    81
                              ('forge', 'email', 'comment', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    82
            self.assertEqual(self.config.reorder_cubes(('forge', 'comment', 'email', 'file')),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    83
                              ('forge', 'email', 'comment', 'file'))
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    84
            self.assertEqual(self.config.reorder_cubes(('comment', 'forge', 'email', 'file')),
2036
68ee0ffb66a7 replace jpl with forge in test
Nicolas Chauvat <nicolas.chauvat@logilab.fr>
parents: 1977
diff changeset
    85
                              ('forge', 'email', 'comment', 'file'))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    86
        finally:
5025
2826f5406201 deprecate __use__ and __recommend__
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5021
diff changeset
    87
            comment_pkginfo.__recommends_cubes__ = {}
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
    88
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
    89
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    90
#     def test_vc_config(self):
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    91
#         vcconf = self.config.vc_config()
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    92
#         self.assertIsInstance(vcconf['EEMAIL'], Version)
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    93
#         self.assertEqual(vcconf['EEMAIL'], (0, 3, 1))
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
    94
#         self.assertEqual(vcconf['CW'], (2, 31, 2))
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    95
#         self.assertRaises(KeyError, vcconf.__getitem__, 'CW_VERSION')
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    96
#         self.assertRaises(KeyError, vcconf.__getitem__, 'CRM')
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
    97
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
    98
    def test_expand_cubes(self):
6349
14ec625b3f55 fix test so that we don't actually depends on file and email cubes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6340
diff changeset
    99
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
14ec625b3f55 fix test so that we don't actually depends on file and email cubes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6340
diff changeset
   100
        self.config.adjust_sys_path()
6411
308f6d0e11ae [test] don't add unnecessary dependency to blog
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6349
diff changeset
   101
        self.assertEqual(self.config.expand_cubes(('email', 'comment')),
308f6d0e11ae [test] don't add unnecessary dependency to blog
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6349
diff changeset
   102
                          ['email', 'comment', 'file'])
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   103
8537
e30d0a7f0087 [config] turn internal configuration methods building appobjects search path into normal method rather than class method
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 7791
diff changeset
   104
    def test_appobjects_path(self):
6349
14ec625b3f55 fix test so that we don't actually depends on file and email cubes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6340
diff changeset
   105
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
14ec625b3f55 fix test so that we don't actually depends on file and email cubes
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6340
diff changeset
   106
        self.config.adjust_sys_path()
10239
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   107
        path = [unabsolutize(p) for p in self.config.appobjects_path()]
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   108
        self.assertEqual(path[0], 'entities')
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   109
        self.assertCountEqual(path[1:4], ['web/views', 'sobjects', 'hooks'])
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   110
        self.assertEqual(path[4], 'file/entities')
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   111
        self.assertCountEqual(path[5:7], ['file/views.py', 'file/hooks'])
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   112
        self.assertEqual(path[7], 'email/entities.py')
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   113
        self.assertCountEqual(path[8:10], ['email/views', 'email/hooks.py'])
495efb844048 [test] don't rely on a stable ordering for appobject_path
Julien Cristau <julien.cristau@logilab.fr>
parents: 9674
diff changeset
   114
        self.assertEqual(path[10:], ['test/data/entities.py', 'test/data/views.py'])
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   115
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   116
    def test_cubes_path(self):
1023
278f997aa257 fix sys.path adjustment
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1015
diff changeset
   117
        # make sure we don't import the email cube, but the stdlib email package
278f997aa257 fix sys.path adjustment
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents: 1015
diff changeset
   118
        import email
6412
370357e68837 [test] cleanup / unittest2 api update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6411
diff changeset
   119
        self.assertNotEqual(dirname(email.__file__), self.config.CUBES_DIR)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   120
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR]
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   121
        self.assertEqual(self.config.cubes_search_path(),
4681
5f72584ab1d7 [test] cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4490
diff changeset
   122
                          [CUSTOM_CUBES_DIR, self.config.CUBES_DIR])
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   123
        self.config.__class__.CUBES_PATH = [CUSTOM_CUBES_DIR,
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   124
                                            self.config.CUBES_DIR, 'unexistant']
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   125
        # filter out unexistant and duplicates
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   126
        self.assertEqual(self.config.cubes_search_path(),
4681
5f72584ab1d7 [test] cleanup
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4490
diff changeset
   127
                          [CUSTOM_CUBES_DIR,
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   128
                           self.config.CUBES_DIR])
9674
96549de9dd70 [test] use assertIn where appropriate
Julien Cristau <julien.cristau@logilab.fr>
parents: 8537
diff changeset
   129
        self.assertIn('mycube', self.config.available_cubes())
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   130
        # test cubes python path
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   131
        self.config.adjust_sys_path()
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   132
        import cubes
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   133
        self.assertEqual(cubes.__path__, self.config.cubes_search_path())
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   134
        # this import should succeed once path is adjusted
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   135
        from cubes import mycube
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   136
        self.assertEqual(mycube.__path__, [join(CUSTOM_CUBES_DIR, 'mycube')])
1015
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   137
        # file cube should be overriden by the one found in data/cubes
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   138
        sys.modules.pop('cubes.file', None)
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   139
        del cubes.file
b5fdad9208f8 search for cubes in a list of directories
sylvain.thenault@logilab.fr
parents: 515
diff changeset
   140
        from cubes import file
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   141
        self.assertEqual(file.__path__, [join(CUSTOM_CUBES_DIR, 'file')])
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
   142
6314
b233cc448bdd [test] add some fake cubes necessary for test so we don't depend on the actual forge cube
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5426
diff changeset
   143
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   144
class FindPrefixTC(TestCase):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   145
    def make_dirs(self, *args):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   146
        path = join(tempfile.tempdir, *args)
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   147
        if not os.path.exists(path):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   148
            os.makedirs(path)
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   149
        return path
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   150
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   151
    def make_file(self, *args):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   152
        self.make_dirs(*args[: -1])
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   153
        file_path = join(tempfile.tempdir, *args)
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   154
        file_obj = open(file_path, 'w')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   155
        file_obj.write('""" None """')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   156
        file_obj.close()
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   157
        return file_path
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   158
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   159
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   160
    def test_samedir(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   161
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   162
        self.make_dirs('share', 'cubicweb')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   163
        self.assertEqual(_find_prefix(prefix), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   164
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   165
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   166
    def test_samedir_filepath(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   167
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   168
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   169
        file_path = self.make_file('bob.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   170
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   171
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   172
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   173
    def test_dir_inside_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   174
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   175
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   176
        dir_path = self.make_dirs('bob')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   177
        self.assertEqual(_find_prefix(dir_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   178
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   179
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   180
    def test_file_in_dir_inside_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   181
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   182
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   183
        file_path = self.make_file('bob', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   184
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   185
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   186
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   187
    def test_file_in_deeper_dir_inside_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   188
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   189
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   190
        file_path = self.make_file('bob', 'pyves', 'alain', 'adim', 'syt', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   191
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   192
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   193
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   194
    def test_multiple_candidate_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   195
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   196
        prefix = self.make_dirs('bob')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   197
        self.make_dirs('bob', 'share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   198
        file_path = self.make_file('bob', 'pyves', 'alain', 'adim', 'syt', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   199
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   200
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   201
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   202
    def test_sister_candidate_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   203
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   204
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   205
        self.make_dirs('bob', 'share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   206
        file_path = self.make_file('bell', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   207
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   208
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   209
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   210
    def test_multiple_parent_candidate_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   211
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   212
        prefix = self.make_dirs('share', 'cubicweb', 'bob')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   213
        self.make_dirs('share', 'cubicweb', 'bob', 'share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   214
        file_path = self.make_file('share', 'cubicweb', 'bob', 'pyves', 'alain', 'adim', 'syt', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   215
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   216
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   217
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   218
    def test_upper_candidate_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   219
        prefix = tempfile.tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   220
        self.make_dirs('share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   221
        self.make_dirs('bell','bob',  'share', 'cubicweb')
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   222
        file_path = self.make_file('bell', 'toto.py')
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   223
        self.assertEqual(_find_prefix(file_path), prefix)
5021
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   224
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   225
    @with_tempdir
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   226
    def test_no_prefix(self):
58e89f3dfbae handle nicely typical installation other than debian package / mercurial forest
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 4691
diff changeset
   227
        prefix = tempfile.tempdir
6340
470d8e828fda [test] update test to unittest2 api (still using lgc.testlib though)
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 6314
diff changeset
   228
        self.assertEqual(_find_prefix(prefix), sys.prefix)
1640
65b60f177eb1 fix tests
sylvain.thenault@logilab.fr
parents: 1341
diff changeset
   229
0
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   230
if __name__ == '__main__':
b97547f5f1fa Showtime !
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
diff changeset
   231
    unittest_main()