Пример #1
0
 def setUp(self):
     self.cfg_loader = cln.ConfigurationLoader()
     self.cfg = self.cfg_loader.load_conf('input/unit_input_004.json')
     self.target_cfg = TargetConfiguration('/this/is/top_dir',
                                           '/this/is/top_dir', 'item01',
                                           'item01-flavor01', '')
     self.instr_cfg = InstrumentConfig(True, 0)
Пример #2
0
 def setUp(self):
     self.base_path = '../inputs/configs'
     self.cfg001 = 'basic_config_001.json'
     self.cfg002 = 'basic_config_002.json'
     self.cfg003 = 'basic_config_003.json'
     self.cfg004 = 'basic_config_004.json'
     self.scl = C.SimplifiedConfigurationLoader()
     self.fm = None
Пример #3
0
 def test_construction_is_singleton(self):
     F.FunctorManager.instance = None
     self.assertIsNone(F.FunctorManager.instance)
     cfg_loader = C.ConfigurationLoader()
     fm = F.FunctorManager.from_config(
         cfg_loader.load_conf('./input/unit_input_001.json'))
     fm2 = F.FunctorManager()
     self.assertEqual(fm.instance, fm2.instance)
     fm.reset()
Пример #4
0
 def setUp(self):
     self.build = '/home/something/top_dir'
     self.b_i_01 = '/builder/item01/directory'
     self.ia_i_01 = '/ins_anal/directory/for/functors'
     self.r_i_01 = '/path/to/runner_functors/item01'
     self.i_01 = 'item01'
     self.flavor = 'vanilla'
     self.cl = C.ConfigurationLoader()
     self.cfg = self.cl.load_conf('./input/unit_input_001.json')
     self.fm = F.FunctorManager(self.cfg)
Пример #5
0
  def test_analyze_local(self):
    ld = C.SimplifiedConfigurationLoader()
    cfg = ld.load_conf('../inputs/configs/basic_config_005.json')

    analyzer = A.Analyzer(cfg)
    fm = F.FunctorManager(cfg)

    a_f = fm.get_or_load_functor('/tmp', 'test_item', 'ct', 'analyze')
    self.assertIsNotNone(a_f)
    self.assertTrue(a_f.get_method()['passive'])
    self.assertEqual(a_f.get_it(), 0)


    tc = TargetConfiguration(cfg.get_place('/tmp'), '/tmp', 'test_item', 'ct', 'asdf')
    with self.assertRaises(RuntimeError) as assert_cm:
      analyzer.analyze(tc, 0)
    rt_err = assert_cm.exception
    self.assertEqual(str(rt_err), 'Analyzer::analyze: Profile Sink in Analyzer not set!')

    analyzer.set_profile_sink(TestProfileSink())
    analyzer.analyze(tc, 0)
    self.assertEqual(a_f.get_it(), 1)
Пример #6
0
 def test_check_basic_config_005(self):
   cl = CL.SimplifiedConfigurationLoader()
   cfg = cl.load_conf('../inputs/configs/basic_config_005.json')
   C.Checker.check_configfile_v2(cfg)
Пример #7
0
 def test_construction_from_classmethod(self):
     cfg_loader = C.ConfigurationLoader()
     fm = F.FunctorManager.from_config(
         cfg_loader.load_conf('./input/unit_input_001.json'))
     fm.reset()
Пример #8
0
 def setUp(self):
     ld = CO.SimplifiedConfigurationLoader()
     self.cfg = ld.load_conf('../inputs/configs/basic_config_005.json')
     pass