Esempio n. 1
0
    def test_getADictWithInvalidValue_test1(self):
        _config_parser.set('config', "log_levels", "plop")
        assert catcher.lastLogRecord is None

        value = get("log_levels")
        assert type(value) is dict
        assert len(value) == 0
        assert catcher.lastLogRecord is not None
Esempio n. 2
0
    def test_getADictWithInvalidValue_test2(self):
        _config_parser.set('config', "log_levels", "plop;toto=tata")
        assert catcher.lastLogRecord is None

        value = get("log_levels")
        assert type(value) is dict
        assert len(value) == 1
        assert catcher.lastLogRecord is not None

        assert "toto" in value
        assert value["toto"] == "tata"
Esempio n. 3
0
 def test_getAnIntWithInvalidValue(self):
     set("proxy_port", 42)
     _config_parser.set('config', "proxy_port", "plop")
     value = get("proxy_port")
     assert value is None
Esempio n. 4
0
 def test_getABoolWithInvalidValue(self):
     set("autorun", False)
     _config_parser.set('config', "autorun", "plop")
     value = get("autorun")
     assert type(value) is bool and value