def test_duplicate_msgid(msgid_store: MessageIdStore) -> None: msgid_store.add_msgid_and_symbol("W1234", "warning-symbol") with pytest.raises(InvalidMessageError) as error: msgid_store.check_msgid_and_symbol("W1235", "warning-symbol") assert ( "Message symbol 'warning-symbol' cannot be used for 'W1234' and 'W1235'" in str(error.value))
def test_duplicate_symbol(empty_msgid_store: MessageIdStore) -> None: empty_msgid_store.add_msgid_and_symbol("W1234", "warning-symbol") with pytest.raises(InvalidMessageError) as error: empty_msgid_store.check_msgid_and_symbol("W1234", "other-symbol") assert ( "Message id 'W1234' cannot have both 'other-symbol' and 'warning-symbol' as symbolic name." in str(error.value))