Esempio n. 1
0
 def _verifyExperimentProfile(self, env):
     profile_type = env.var('experiment_profile')
     profile_inst = env.var('experiment_profile_inst')
     env.logger.info('Experiment profile: %s' % profile_type)
     exp_profile = importComponent(profile_type)
     profile = AppProfile(exp_profile, profile_inst)
     env.addVar('profile', profile)
     env.logger.info('Configured experiment profile (%d elements found)' %
                     (len(profile.keys())))
Esempio n. 2
0
 def test_init4(self):
     # wrong type of component
     with self.assertRaises(Error):
         AppProfile(self.def_p1, self.px2)
Esempio n. 3
0
 def test_init2(self):
     # profile definition specifies only the required components
     p = AppProfile(self.def_p1, self.p2)
     self.assertEqual(self.p1, p._cfg)
     # extra profile components are silently ignored
     self.assertNotIn('key6', p.keys())
Esempio n. 4
0
 def test_init3(self):
     # missing required component
     with self.assertRaises(Error):
         AppProfile(self.def_p1, self.px1)
Esempio n. 5
0
 def test_init1(self):
     p = AppProfile(self.def_p1, self.p1)
     self.assertEqual(self.p1, p._cfg)
     self.assertItemsEqual(self.p1.keys(), p.keys())
     for pk in self.p1.keys():
         self.assertEqual(self.p1[pk], p[pk])