equal
deleted
inserted
replaced
1 import os |
1 import os |
2 from os.path import join, dirname |
2 from os.path import join, dirname |
3 from shutil import rmtree |
3 from shutil import rmtree |
|
4 import errno |
|
5 import tempfile |
4 |
6 |
5 from logilab.common.testlib import TestCase, unittest_main |
7 from logilab.common.testlib import TestCase, unittest_main |
6 |
8 |
7 from cubicweb.web.propertysheet import PropertySheet, lazystr |
9 from cubicweb.web.propertysheet import PropertySheet, lazystr |
8 |
10 |
9 DATADIR = join(dirname(__file__), 'data') |
11 DATADIR = join(dirname(__file__), 'data') |
10 CACHEDIR = join(DATADIR, 'uicache') |
12 |
|
13 try: |
|
14 os.makedirs(join(DATADIR, 'uicache')) |
|
15 except OSError as err: |
|
16 if err.errno != errno.EEXIST: |
|
17 raise |
|
18 CACHEDIR = tempfile.mkdtemp(dir=join(DATADIR, 'uicache')) |
11 |
19 |
12 class PropertySheetTC(TestCase): |
20 class PropertySheetTC(TestCase): |
13 |
21 |
14 def tearDown(self): |
22 def tearDown(self): |
15 rmtree(CACHEDIR) |
23 rmtree(CACHEDIR) |