~afb/smart/solaris

« back to all changes in this revision

Viewing changes to tests/initialization.py

  • Committer: Anders F Bjorklund
  • Date: 2009-03-11 10:07:49 UTC
  • mfrom: (856.1.8 bugfix)
  • Revision ID: afb@users.sourceforge.net-20090311100749-g9n4xrouwqmbam8s
merge changes from trunk, via bugfix

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import pickle
1
2
import sys
2
3
 
3
4
from tests.mocker import MockerTestCase
4
5
 
5
 
from smart import initPlugins
 
6
from smart import initPlugins, sysconf
6
7
 
7
8
 
8
9
class InitPluginsTest(MockerTestCase):
9
10
 
10
11
    def setUp(self):
11
12
        from smart import const
 
13
        self.old_sysconf = pickle.dumps(sysconf.object)
12
14
        self.old_plugins_dir = const.PLUGINSDIR
13
15
        self.plugins_dir = self.makeDir()
14
16
        const.PLUGINSDIR = self.plugins_dir
16
18
    def tearDown(self):
17
19
        from smart import const
18
20
        const.PLUGINSDIR = self.old_plugins_dir
 
21
        sysconf.object = pickle.loads(self.old_sysconf)
19
22
 
20
23
    def test_plugins_dir_is_used(self):
21
24
        self.makeFile("import sys; sys.test_worked = True",