Пример #1
0
 def rmttest_positive_02(self):
     "TopicSet - valid"
     cfg = Cfg()
     cfg.set_value('hahaha.directory',
                   'tests/unit-test/topic-tests/testdata/topicset01')
     cfg.set_value('hahaha.name', 't01')
     cfg.set_value('topics.test-name01.output', {})
     cfg.set_value('topic_root_node', 'RootNode')
     tvcs = TestVCS(cfg)
     tobjcache = ObjectCache()
     tinmod = TestInputModules()
     TopicSet(cfg, tvcs, "test-name01", tobjcache, tinmod)
Пример #2
0
 def __init__(self, input_mods, config):
     '''Sets up a TopicContinuum for use.'''
     tracer.info("called")
     UsableFlag.__init__(self)
     self.__input_mods = input_mods
     self._config = config
     # This dictionary holds all the TopicSetCollections
     # available in the configured time period.
     self.__continuum = {}
     # Store objects with IDs also in the cache - so that they can be reused.
     self.__object_cache = ObjectCache()
     self.__init_continuum_set()
     self.__object_cache.log_stats()
     tracer.debug("Finished.")
Пример #3
0
    def test_positive_03(self):
        "TopicSet - valid with empty requirement set"

        tioconfig = TxtIOConfig()
        cfg = Cfg()
        cfg.set_value('huhuhu.directory',
                      'tests/unit-test/topic-tests/testdata/topicset01')
        cfg.set_value('huhuhu.name', 't01')
        cfg.set_value('topics.test-name02.output', {})
        cfg.set_value('topic_root_node', 'RootNode')
        tvcs = TestVCS(cfg)
        tobjcache = ObjectCache()
        tinmod = TestInputModules()
        topicset = TopicSet(cfg, tvcs, "test-name02", tobjcache, tinmod)
Пример #4
0
def main_impl(args, mstdout, mstderr):
    tracer.debug("Called.")
    config, mods = MainHelper.main_setup(args, mstdout, mstderr)

    file_system_if = FileSystem(config)
    object_cache = ObjectCache()

    rs = RequirementSet(config)
    command_line_args = config.get_rvalue('general.command_line_arguments')

    rs.read_requirements(file_system_if, None, mods, object_cache)

    return rs.normalize_dependencies() \
        and rs.write_to_filesystem(command_line_args[0])
Пример #5
0
    def rmttest_positive_01(self):
        "TopicSet - constructor with only one element"
        try:
            cfg = Cfg()
            cfg.set_value('ahah.directory',
                          'tests/unit-test/topic-tests/testdata/topicset01')
            cfg.set_value('ahah.name', 't01')
            cfg.set_value('topics.bkdkd.output', {})

            cfg.set_value('topic_root_node', 'RootNode')
            tvcs = TestVCS(cfg)
            tobjcache = ObjectCache()
            tinmod = TestInputModules()
            TopicSet(cfg, tvcs, "bkdkd", tobjcache, tinmod)
            self.assertTrue(False)
        except AssertionError:
            pass
Пример #6
0
def main_func(args, mstdout, mstderr):
    """The 'real' main function.

    Sets up everything, reads in the requirements and
    writes out everything.
    """
    tracer.debug("Called.")
    config, mods = MainHelper.main_setup(args, mstdout, mstderr)

    file_system_if = FileSystem(config)
    object_cache = ObjectCache()

    req_set = RequirementSet(config)
    command_line_args = config.get_rvalue('general.command_line_arguments')

    req_set.read_requirements(file_system_if, None, mods, object_cache)
    return req_set.normalize_dependencies() \
        and req_set.write_to_filesystem(command_line_args[0])