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)
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)
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)
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)
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)
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)
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
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
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")
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
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)
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'")
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")