Ejemplo n.º 1
0
    def rmttest_pos_01(self):
        "TxtIOConfig: check new max line length setting"
        config = Cfg()
        config.set_value('max_input_line_length', 77)

        tic = TxtIOConfig(config, 'requirement')

        assert(tic.get_max_line_length() == 77)
Ejemplo n.º 2
0
    def test_pos_01(self):
        "TxtIOConfig: check new max line length setting"
        config = Cfg()
        config.set_value('max_input_line_length', 77)

        tic = TxtIOConfig(config, 'requirement')

        assert (tic.get_max_line_length() == 77)
Ejemplo n.º 3
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)
Ejemplo n.º 4
0
    def rmttest_positive_03(self):
        "TopicSet - valid with empty requirement set"

        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(cfg, tvcs, "test-name02", tobjcache, tinmod)
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
 def test_positive_02(self):
     "TopicSet - valid"
     tioconfig = TxtIOConfig()
     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', {})
     tioconfig = TxtIOConfig()
     cfg.set_value('topic_root_node', 'RootNode')
     tvcs = TestVCS(cfg)
     tobjcache = ObjectCache()
     tinmod = TestInputModules()
     topicset = TopicSet(
         cfg, tvcs, "test-name01", tobjcache, tinmod)
Ejemplo n.º 7
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
Ejemplo n.º 8
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)
            assert False
        except AssertionError:
            pass
Ejemplo n.º 9
0
 def test_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', {})
     tioconfig = TxtIOConfig()
     topicset = TopicSet(
         None, cfg, "test-name01", "hahaha")
Ejemplo n.º 10
0
 def test_positive_01(self):
     "TopicSet - constructor with only one element"
     try:
         tioconfig = TxtIOConfig()
         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', {})
         topicset = TopicSet(None, cfg, "bkdkd", "ahah")
         assert(False)
     except AssertionError, ae:
         pass
Ejemplo n.º 11
0
    def test_neg_01(self):
        "ReqsContinuum: check exception when vcs is needed but not available"
        try:
            tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

            config = Cfg()
            config.set_value('requirements.input.commit_interval.begin', 'v1')
            config.set_value('requirements.input.commit_interval.end', 'v7')
            config.set_value('requirements.input.directory', tdir)

            ReqsContinuum(None, config)
            assert(False)
        except RMTException, rmte:
            shutil.rmtree(tdir)
            assert(rmte.id() == 40)
Ejemplo n.º 12
0
    def test_neg_02(self):
        "ReqsContinuum: check exception when vcs is needed but not available \
        (entry point in execute_cmds())"

        tdir = tempfile.mkdtemp(prefix="rmtoo-tst-ctnt-")

        config = Cfg()
        config.set_value('requirements.input.commit_interval.begin', 'v1')
        config.set_value('requirements.input.commit_interval.end', 'v7')
        config.set_value('requirements.input.directory', tdir)

        mstderr = StringIO.StringIO()

        rval = execute_cmds(config, None, None, mstderr)

        assert(rval == False)
        print("ERROR IS [%s]" % mstderr.getvalue())
        assert(mstderr.getvalue() == "+++ ERROR: Problem reading in "
               "the continuum: '[  40]: Based on the config "
               "a repository is needed - but there is none'")
Ejemplo n.º 13
0
    def test_positive_03(self):
        "TopicSet - valid with empty requirement set"

        class ReqSet(Digraph):

            def __init__(self):
                self.mods = None
                self.opts = None
                self.config = None
                self.reqs = {}

        rs = ReqSet()

        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', {})
        topicset = TopicSet(
            rs, cfg, "test-name02", "huhuhu")