def test_build_mistyped_path_config_option():
    config = {
        "SymbolPath": [
            Rule('Path', 'contains', '1337', True),
            Rule('pid', 'is_not', '1338', True),
            Rule('Event_class', 'is', 'Profiling', False),
            Rule('Path', 'ends_with', '$Mft', False),
        ]
    }
    with pytest.raises(TypeError):
        _ = dumps_configuration(config)
Beispiel #2
0
def test_build_mistyped_rule():
    config = {
        u"FilterRules": [
            Rule('Path', 'contains', u'1337', True),
            Rule('pid', 'is_not', u'1338', True),
            Rule('Event_class', 'is', u'Profiling', False),
            u"SomeString",
        ]
    }
    with pytest.raises(AttributeError):
        _ = dumps_configuration(config)
def test_parse_built_configuration_sanity():
    config = {
        "SymbolPath":
        "",
        "DbgHelpPath":
        "C:\\Windows\\help.dll",
        "FilterRules": [
            Rule('Path', 'contains', '1337', True),
            Rule('pid', 'is_not', '1338', True),
            Rule('Event_class', 'is', 'Profiling', False),
            Rule('Path', 'ends_with', '$Mft', False),
        ],
    }

    raw_config = dumps_configuration(config)
    parsed_raw_config = loads_configuration(raw_config)
    assert config == parsed_raw_config, "Parsed Built configuration is not equal to the original configuration"
def test_build_parsed_configuration(raw_config_full):
    config = loads_configuration(raw_config_full)
    raw_built_config = dumps_configuration(config)
    assert raw_built_config == raw_config_full, "Built configuration is different then the original one"
def test_build_nonexistent_config_option():
    config = {u"FilterRules2": b"datadatadatadatadatadatadatadata"}

    raw_config = dumps_configuration(config)
    parsed_raw_config = loads_configuration(raw_config)
    assert config == parsed_raw_config, "Parsed Built configuration is not equal to the original configuration"