コード例 #1
0
def test_specific_modules_invalid_type():
    from felling.src.configure_felling import _specific_modules

    config = {"loggers": {"DEBUG only": "DEBUG only handler"}}
    with pytest.raises(TypeError,
                       match="module 5 must be a ModuleType or str."):
        _specific_modules(config, 5, "DEBUG")
コード例 #2
0
def test_specific_modules_multiple_module_debug_only():
    from felling.src.configure_felling import _specific_modules

    config = {"loggers": {"DEBUG only": "DEBUG only handler"}}
    config = _specific_modules(config, [re, os], "DEBUG")
    assert config["loggers"]["re"] == "DEBUG only handler"
    assert config["loggers"]["os"] == "DEBUG only handler"
コード例 #3
0
def test_specific_modules_multiple_str_module():
    from felling.src.configure_felling import _specific_modules

    config = {"loggers": {"DEBUG only": "DEBUG only handler"}}
    config = _specific_modules(config, ["Ash", "Birch"], "DEBUG")
    assert config["loggers"]["Ash"] == "DEBUG only handler"
    assert config["loggers"]["Birch"] == "DEBUG only handler"
コード例 #4
0
def test_specific_modules_multiple_module_error_only():
    from felling.src.configure_felling import _specific_modules

    config = {"loggers": {"ERROR only": "ERROR only handler"}}
    config = _specific_modules(config, [re, os], "ERROR")
    assert config["loggers"]["re"] == "ERROR only handler"
    assert config["loggers"]["os"] == "ERROR only handler"