equal
deleted
inserted
replaced
34 |
34 |
35 from cubicweb.devtools import ApptestConfiguration |
35 from cubicweb.devtools import ApptestConfiguration |
36 from cubicweb.devtools.testlib import BaseTestCase, TemporaryDirectory |
36 from cubicweb.devtools.testlib import BaseTestCase, TemporaryDirectory |
37 from cubicweb.cwconfig import ( |
37 from cubicweb.cwconfig import ( |
38 CubicWebConfiguration, _expand_modname) |
38 CubicWebConfiguration, _expand_modname) |
39 |
|
40 |
|
41 def unabsolutize(path): |
|
42 parts = path.split(os.sep) |
|
43 for i, part in reversed(tuple(enumerate(parts))): |
|
44 if part.startswith('cubicweb_'): |
|
45 return os.sep.join([part[len('cubicweb_'):]] + parts[i + 1:]) |
|
46 if part.startswith('cubicweb') or part == 'legacy_cubes': |
|
47 return os.sep.join(parts[i + 1:]) |
|
48 raise Exception('duh? %s' % path) |
|
49 |
39 |
50 |
40 |
51 def templibdir(func): |
41 def templibdir(func): |
52 """create a temporary directory and insert it in sys.path""" |
42 """create a temporary directory and insert it in sys.path""" |
53 @functools.wraps(func) |
43 @functools.wraps(func) |