def test_positive_01(self): "Requirement contains a tag where no handler exists" mods = Modules(os.path.join(mod_base_dir, "modules08"), {}, {}, [], mods_list("modules08", mod_base_dir)) sio = StringIO.StringIO("Hubbel: bubbel") req = Requirement(sio, "hubbel", None, mods, None, TestConfig()) reqs = RequirementSet(mods, None, None) reqs.add_req(req) reqs.handle_modules() assert(reqs.mls()==MemLogStore.create_mls( [[57, MemLog.error, "No tag handler found for tag(s) " "'['Hubbel']' - Hint: typo in tag(s)?", 'hubbel'], [56, MemLog.error, "There were errors encountered during " "parsing and checking - can't continue"] ] ))
def test_positive_02(self): "Requirement contains a tag where no handler exists - multiple tags" mods = Modules(os.path.join(mod_base_dir, "modules08"), {}, {}, [], mods_list("modules08", mod_base_dir)) sio = StringIO.StringIO("Hubbel: bubbel\nSiebel: do") req = Requirement(sio, "InvalidTagReq", None, mods, None, TestConfig()) reqs = RequirementSet(mods, None, None) reqs.add_req(req) reqs.handle_modules() #o = StringIO.StringIO() #reqs.write_log(o) #print("HHHHHHHHHHH %s" % o.getvalue()) assert(reqs.mls()==MemLogStore.create_mls( [[57, MemLog.error, "No tag handler found for tag(s) " "'['Siebel', 'Hubbel']' - Hint: typo in tag(s)?", 'InvalidTagReq'], [56, MemLog.error, "There were errors encountered during " "parsing and checking - can't continue"]] ))