def rmttest_negative_01(self): "Requirement Tag Owner - no tag given" config, req = create_parameters() config.stakeholders = ["marketing", "security"] rt = ReqOwner(config) with self.assertRaises(RMTException) as rmte: rt.rewrite("Owner-test", req) self.assertEqual(10, rmte.id())
def rmttest_negative_01(self): "Requirement Tag Owner - no tag given" config, req = create_parameters() config.stakeholders = ["marketing", "security"] rt = ReqOwner(config) with pytest.raises(RMTException) as rmte: rt.rewrite("Owner-test", req) assert 10 == rmte.id()
def rmttest_negative_02(self): "Requirement Tag Owner - invalid tag given" config, req = create_parameters() config.set_value('requirements.stakeholders', ["marketing", "security"]) req["Owner"] = RecordEntry("Owner", "SomethingDifferent") rt = ReqOwner(config) with self.assertRaises(RMTException) as rmte: rt.rewrite("Owner-test", req) self.assertEqual(11, rmte.id())
def rmttest_negative_02(self): "Requirement Tag Owner - invalid tag given" config, req = create_parameters() config.set_value('requirements.stakeholders', ["marketing", "security"]) req["Owner"] = RecordEntry("Owner", "SomethingDifferent") rt = ReqOwner(config) with pytest.raises(RMTException) as rmte: rt.rewrite("Owner-test", req) assert 11 == rmte.id()
def test_negative_01(self): "Requirement Tag Owner - no tag given" config, req = create_parameters() config.stakeholders = ["marketing", "security"] rt = ReqOwner(config) try: name, value = rt.rewrite("Owner-test", req) assert(False) except RMTException, rmte: assert(rmte.id() == 10)
def test_positive_01(self): "Requirement Tag Owner - tag given" config, req = create_parameters() config.set_value('requirements.stakeholders', ["marketing", "security"]) req["Owner"] = RecordEntry("Owner", "marketing") rt = ReqOwner(config) name, value = rt.rewrite("Owner-test", req) assert(name == "Owner") assert(value == "marketing")
def test_negative_02(self): "Requirement Tag Owner - invalid tag given" config, req = create_parameters() config.set_value('requirements.stakeholders', ["marketing", "security"]) req["Owner"] = RecordEntry("Owner", "SomethingDifferent") rt = ReqOwner(config) try: name, value = rt.rewrite("Owner-test", req) assert(False) except RMTException, rmte: assert(rmte.id() == 11)