def rmttest_positive_01(self):
        "Requirement Tag Priority - no tag given"
        config, req = create_parameters()

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert "Factor" == name
        assert 0.0 == value
Exemple #2
0
    def test_positive_01(self):
        "Requirement Tag Priority - no tag given"
        config, req = create_parameters()

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert(name == "Factor")
        assert(value == 0.0)
Exemple #3
0
    def rmttest_positive_01(self):
        "Requirement Tag Priority - no tag given"
        config, req = create_parameters()

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert "Factor" == name
        assert 0.0 == value
Exemple #4
0
    def rmttest_positive_01(self):
        "Requirement Tag Priority - no tag given"
        config, req = create_parameters()

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        self.assertEqual("Factor", name)
        self.assertEqual(0.0, value)
    def rmttest_positive_03(self):
        "Requirement Tag Priority - tag given two stakeholders"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "marketing:7 security:3")

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert "Factor" == name
        assert 0.5 == value
Exemple #6
0
    def test_positive_03(self):
        "Requirement Tag Priority - tag given two stakeholders"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "marketing:7 security:3")

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert(name == "Factor")
        assert(value == 0.5)
Exemple #7
0
    def test_positive_02(self):
        "Requirement Tag Priority - tag given one stakeholder"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "marketing:7")

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert(name == "Factor")
        assert(value == 0.7)
Exemple #8
0
    def rmttest_positive_02(self):
        "Requirement Tag Priority - tag given one stakeholder"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "marketing:7")

        rt = ReqPriority(config)
        name, value = rt.rewrite("Priority-test", req)
        assert "Factor" == name
        assert 0.7 == value
    def rmttest_negative_04(self):
        "Requirement Tag Priority - invalid priority (too big)"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "security:30")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert False
        except RMTException as rmte:
            assert 15 == rmte.get_id()
Exemple #10
0
    def test_negative_04(self):
        "Requirement Tag Priority - invalid priority (too big)"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "security:30")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert(False)
        except RMTException, rmte:
            assert(rmte.id() == 15)
Exemple #11
0
    def test_negative_02(self):
        "Requirement Tag Priority - invalid stakeholder"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "nixda:3")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert(False)
        except RMTException, rmte:
            assert(rmte.id() == 13)
Exemple #12
0
    def rmttest_negative_02(self):
        "Requirement Tag Priority - invalid stakeholder"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "nixda:3")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert False
        except RMTException as rmte:
            assert 13 == rmte.get_id()
Exemple #13
0
    def rmttest_negative_01(self):
        "Requirement Tag Priority - faulty priority declaration ':'"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority", "marketing:")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            self.assertTrue(False)
        except RMTException as rmte:
            self.assertEqual(12, rmte.get_id())
    def rmttest_negative_03(self):
        "Requirement Tag Priority - stakeholder voted more than once"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority",
                                      "security:3 marketing:7 security:4")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert False
        except RMTException as rmte:
            assert 14 == rmte.get_id()
Exemple #15
0
    def test_negative_03(self):
        "Requirement Tag Priority - stakeholder voted more than once"
        config, req = create_parameters()
        config.set_value('requirements.stakeholders',
                         ["marketing", "security"])
        req["Priority"] = RecordEntry("Priority",
                                      "security:3 marketing:7 security:4")

        rt = ReqPriority(config)
        try:
            name, value = rt.rewrite("Priority-test", req)
            assert(False)
        except RMTException, rmte:
            assert(rmte.id() == 14)