Exemplo n.º 1
0
def test_message_not_eq(source, target):
    assert Message(*source) != Message(*target)
Exemplo n.º 2
0
def test_message_err_keys(errors, true_err_keys):
    assert Message("x", errors=errors).err_keys == true_err_keys
Exemplo n.º 3
0
        }, {"2", "3"}),
        (None, set()),
    ],
)
def test_message_err_keys(errors, true_err_keys):
    assert Message("x", errors=errors).err_keys == true_err_keys


@pytest.mark.parametrize(
    "messages, true_err_keys",
    [
        (
            {
                Level.ERROR: [
                    Message("x", errors={
                        "a": {1, 2, 3},
                        "b": {2, 3}
                    }),
                    Message("x", errors={
                        "a": {3, 5},
                        "b": {3}
                    }),
                ]
            },
            {1, 2, 3, 5},
        ),
        (dict(), set()),
    ],
)
def test_result_err_keys(messages, true_err_keys):
    assert Result("x", messages=messages).err_keys == true_err_keys