Exemplo n.º 1
0
    def rmttest_neg_01(self):
        "LaTeX output: check invalid tag in topic"

        tcfg = TestConfig()
        tcfg.set_output_cfg()

        tvcs = TestVCS(tcfg)
        tfile = tvcs.get_tfile1()

        topic = Topic(None, u"TName", tvcs, None, tfile, None)
        topic.t = [
            RecordEntry(u"CompleteleOther", u"My content"),
        ]

        rset = RequirementSet(tcfg)

        ttopic_set = TestTopicSet(rset)

        mconfig = self.__def_mconfig
        req_proc = latex2(mconfig)

        try:
            req_proc.topic_set_pre(ttopic_set)
            topic.execute(req_proc, "")
            assert False
        except RMTException:
            pass
        req_proc.topic_set_post(ttopic_set)
Exemplo n.º 2
0
    def rmttest_neg_01(self):
        "LaTeX output: check invalid tag in topic"

        tcfg = TestConfig()
        tcfg.set_output_cfg()

        tvcs = TestVCS(tcfg)
        tfile = tvcs.get_tfile1()

        topic = Topic(None, u"TName", tvcs, None, tfile, None)
        topic.t = [
            RecordEntry(u"CompleteleOther", u"My content"),
        ]
        tmpdir = create_tmp_dir()

        rset = RequirementSet(tcfg)

        ttopic_set = TestTopicSet(rset)

        mconfig = {
            "output_filename": os.path.join(tmpdir, "TestLateX2Out.tex")
        }
        out_l2 = latex2(mconfig)

        try:
            out_l2.topic_set_pre(ttopic_set)
            topic.execute(out_l2, "")
            assert False
        except RMTException:
            pass
        out_l2.topic_set_post(ttopic_set)
        delete_tmp_dir(tmpdir)
Exemplo n.º 3
0
    def test_neg_01(self):
        "LaTeX output: check invalid tag in topic"

        tcfg = TestConfig()
        tcfg.set_output_cfg()

        tvcs = TestVCS(tcfg)
        tfile = tvcs.get_tfile1()

        dg = Digraph()

        topic = Topic(dg, "TName", tvcs, None, tfile, None)
        topic.t = [RecordEntry("CompleteleOther", "My content"), ]
        tmpdir = create_tmp_dir()

        rset = RequirementSet(tcfg)

        ttopic_set = TestTopicSet(rset)

        mconfig = {"output_filename": os.path.join(tmpdir, "TestLateX2Out.tex")}
        l2 = latex2(mconfig)

        try:
            l2.topic_set_pre(ttopic_set)
            topic.execute(l2, "")
            assert(False)
        except RMTException, rmte:
            pass
Exemplo n.º 4
0
    def rmttest_neg_01(self):
        "LaTeX output: check invalid tag in topic"

        tcfg = TestConfig()
        tcfg.set_output_cfg()

        tvcs = TestVCS(tcfg)
        tfile = tvcs.get_tfile1()

        topic = Topic(None, u"TName", tvcs, None, tfile, None)
        topic.t = [RecordEntry(u"CompleteleOther", u"My content"), ]

        rset = RequirementSet(tcfg)

        ttopic_set = TestTopicSet(rset)

        mconfig = self.__def_mconfig
        req_proc = latex2(mconfig)

        try:
            req_proc.topic_set_pre(ttopic_set)
            topic.execute(req_proc, "")
            assert False
        except RMTException:
            pass
        req_proc.topic_set_post(ttopic_set)
Exemplo n.º 5
0
    def rmttest_neg_01(self):
        "Topic: (internal) check if Name tag exists"
        dg = Digraph()

        tconfig = TestConfig()
        tconfig.set_value("topic_root_node", "/nothing/compare")
        tvcs = TestVCS(tconfig)
        tfileinfo = TestVCS.FileInfo(1)

        with self.assertRaises(RMTException) as rmte:
            Topic(dg, tconfig, tvcs, None, tfileinfo, None)
            self.assertEqual(62, rmte.get_id())
Exemplo n.º 6
0
    def test_neg_01(self):
        "Topic: (internal) check if Name tag exists"
        dg = Digraph()

        tconfig = TestConfig()
        tconfig.set_value("topic_root_node", "/nothing/compare")
        tvcs = TestVCS(tconfig)
        tfileinfo = TestVCS.FileInfo(1)

        try:
            topic = Topic(dg, tconfig, tvcs, None, tfileinfo, None)
            assert (False)
        except RMTException, rmte:
            assert (rmte.id() == 62)
Exemplo n.º 7
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)
Exemplo n.º 8
0
    def test_neg_02(self):
        "LaTeX output: check invalid tag in requirement output config"

        tcfg = TestConfig()
        tcfg.set_output_cfg()

        tvcs = TestVCS(tcfg)
        tfile = tvcs.get_tfile1()

        tmpdir = create_tmp_dir()
        mconfig = { "req_attributes": ["Status", "Class", "DoesNotExists"],
                    "output_filename": os.path.join(tmpdir, "TestLateX2Out.tex")}

        l2 = latex2(mconfig)
        req = Requirement(None, "TestReq", None, None, None)
        req.values = {}
        req.values["Name"] = RecordEntry("Name", "my name")
        req.values["Type"] = Requirement.rt_requirement
        req.values["Description"] = RecordEntry("Description", "my desc")
        req.values["Status"] = RequirementStatusFinished(
                None, "rid", "finished:meiner:2011-04-15:4h")
        req.values["Class"] = ClassTypeImplementable()

        dnreq = RequirementDNode(req)

        ce3set = CE3Set()
        ce3 = CE3()
        ce3set.insert("TestReq", ce3)

        rset = RequirementSet(tcfg)
        ttopic_set = TestTopicSet(rset)

        try:
            l2.topic_set_pre(None)
            dnreq.execute(l2, "")
            assert(False)
        except RMTException, rmte:
            pass
Exemplo n.º 9
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)
Exemplo n.º 10
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