예제 #1
0
    def __read_commits(self, input_handler, commits):
        '''Creates a TopicSet for each commit with the help of
           the input_handler.'''
        tracer.debug("Called.")
        for commit in commits:
            tracer.debug("Handling commit [%s]", commit)
            topic_set_vcs_id = \
                input_handler.get_vcs_id_with_type(commit, "topics")
            tracer.debug("Read topics with oid [%s]", topic_set_vcs_id)
            topic_set = self.__object_cache.get("TopicSet", topic_set_vcs_id)

            if topic_set is None:
                tracer.debug("TopicSet with ID [%s] not in cache",
                             topic_set_vcs_id)
                topic_set = TopicSet(self._config, input_handler, commit,
                                     self.__object_cache, self.__input_mods)
                self.__object_cache.add(topic_set_vcs_id, "TopicSet",
                                        topic_set)
                self._adapt_usablility(topic_set)

            commit_info = CommitInfo(input_handler, commit, topic_set_vcs_id)
            tswci = TopicSetWCI(topic_set, commit_info)
            tracer.debug("Add topic set [%s]", topic_set_vcs_id)
            self.__continuum_add(commit_info, tswci)
            tracer.debug("Finished.")
예제 #2
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)
예제 #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 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