def test_has_any_messages(self): l10n = get_l10n() assert fluent.ftl_has_messages(l10n, 'fluent-title', 'brand-new-string', require_all=False) assert not fluent.ftl_has_messages( l10n, 'brand-new-string', require_all=False)
def test_has_all_messages(self): l10n = get_l10n() assert fluent.ftl_has_messages(l10n, "fluent-title", "fluent-page-desc") assert not fluent.ftl_has_messages(l10n, "fluent-title", "fluent-page-desc", "brand-new-string")
def ftl_has_messages(ctx, *message_ids, require_all=True): """Return True if the current translation has all of the message IDs.""" return fluent.ftl_has_messages(ctx["fluent_l10n"], *message_ids, require_all=require_all)
def test_has_all_messages(self): l10n = get_l10n() assert fluent.ftl_has_messages(l10n, 'fluent-title', 'fluent-page-desc') assert not fluent.ftl_has_messages( l10n, 'fluent-title', 'fluent-page-desc', 'brand-new-string')