<commit_before>-module(global_changes_tests).

-include_lib("couch/include/couch_eunit.hrl").
-include_lib("couch/include/couch_db.hrl").

setup() ->
    Host = get_host(),
    add_admin("admin", <<"pass">>),
    DbName = "foo/" ++ ?b2l(?tempdb()),
    fabric:create_db(DbName, [?ADMIN_CTX]),
    {Host, DbName}.

teardown({_, DbName}) ->
    delete_admin("admin"),
    ok = fabric:delete_db(?l2b(DbName), [?ADMIN_CTX]),
    ok.

global_changes_test_() ->
    {
        "Checking global_changes endpoint",
        {
            setup,
            fun() -> test_util:start_couch([chttpd, global_changes]) end,
            fun test_util:stop/1,
            [
                check_response()
            ]<commit_msg>Fix global_changes tests<commit_after>-module(global_changes_tests).

-include_lib("couch/include/couch_eunit.hrl").
-include_lib("couch/include/couch_db.hrl").

setup() ->
    Host = get_host(),
    add_admin("admin", <<"pass">>),
    DbName = "foo/" ++ ?b2l(?tempdb()),
    [fabric:create_db(Name, [?ADMIN_CTX])
        || Name <- ["_global_changes", DbName]],
    {Host, DbName}.

teardown({_, DbName}) ->
    delete_admin("admin"),
    [fabric:delete_db(Name, [?ADMIN_CTX])
        || Name <- ["_global_changes", DbName]],
    ok.

global_changes_test_() ->
    {
        "Checking global_changes endpoint",
        {
            setup,
            fun() -> test_util:start_couch([chttpd, global_changes]) end,
            fun test_util:stop/1,
            [
                check_response()
            ]
{'fraction_non_alphanumeric': 0.1732283464566929, 'fraction_numerical': 0.0032808398950131233, 'mean_word_length': 2.6052009456264775, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5691934', 'n_tokens_mistral': 546, 'n_tokens_neox': 525, 'n_words': 75}