Exemple #1
0
    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)
Exemple #2
0
 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
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
    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)
Exemple #6
0
 def __init__(self):
     ConfigUtils.set_defaults(self)