def test_pos_01(self): "config.parser is available, but no other value" tc = TestConfig() tc.parser = {} ConfigUtils.set_defaults_parser(tc) ConfigUtils.check(tc) assert(tc.txtio["requirements"].get_max_line_length()==80) assert(tc.txtio["topics"].get_max_line_length()==80)
def test_neg_03(self): "Wrong value in requirements max_line_length" tc = TestConfig() tc.parser = {} tc.parser["requirements"] = {} tc.parser["requirements"]["max_line_length"] = -112 try: ConfigUtils.set_defaults_parser(tc) ConfigUtils.check(tc) assert(False) except RMTException, rmte: assert(rmte.id()==72)
def test_neg_02(self): "Wrong type in requirements max_line_length" tc = TestConfig() tc.parser = {} tc.parser["requirements"] = {} tc.parser["requirements"]["max_line_length"] = \ set(["Das gibbt es nich",]) try: ConfigUtils.set_defaults_parser(tc) ConfigUtils.check(tc) assert(False) except RMTException, rmte: assert(rmte.id()==71)