def test_neg_01(self): "Wrong value in dependency_notation" tc = TestConfig() tc.reqs_spec["dependency_notation"] = set(["Das gibbt es nich",]) try: ConfigUtils.check(tc) assert(False) except RMTException, rmte: assert(rmte.id()==70)
def load_config(opts): # Load config file # ('execfile' does not work here.) f = file(opts.config_file, "r") conf_file = f.read() exec(conf_file) config = Config() ConfigUtils.set_defaults(config) ConfigUtils.check(config) f.close() return config
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)