<commit_before>#!/usr/bin/env python

import os
plugin_to_load = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                              "../plugins/github.hy")

from hy.importer import import_file_to_module

g = import_file_to_module("github", plugin_to_load)


def test_get_github_issue():
    expected = " ".join(
        ["Issue #" + "180", "on", "hylang/hy", "by",
         "khinsen:",
         "Macro expansion works differently from Lisp conventions",
         "(open)",
         "<https://github.com/hylang/hy/issues/180>"])
    actual = g.get_github_issue(None, None, "180", dry_run=True)
    assert expected == actual


def test_get_github_commit():
    expected = " ".join(
        ["Commit", "3e8941c", "on", "hylang/hy", "by",
         "<NAME>:",
         "Convert stdout and stderr to UTF-8 properly in the run_cmd helper.",
         "<https://github.com/hylang/hy" +
         "/commit/3e8941cdde01635890db524c4789f0640fe665c3>"])
    actual = g.get_github_commit(None, None, "3e8941c", dry_run=True)
    assert expected == actual


def test_get_core_members():
    expected = "Core Team consists of: " + \
               ", ".join(["<NAME>", "<NAME>",
                          "<NAME>", "<NAME>",
                          "<NAME>", "khinsen",
                          "<NAME>", "<NAME>",
                          "<NAME>", "<NAME>",
                          "<NAME>"])
    actual = g.get_core_members(None, None, dry_run=True)
    assert actual == expected<commit_msg>Test case of getting core members updated to include <NAME> (either he was added recently to core or I had missed it before some how but test was passing :-/ )<commit_after>#!/usr/bin/env python

import os
plugin_to_load = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                              "../plugins/github.hy")

from hy.importer import import_file_to_module

g = import_file_to_module("github", plugin_to_load)


def test_get_github_issue():
    expected = " ".join(
        ["Issue #" + "180", "on", "hylang/hy", "by",
         "khinsen:",
         "Macro expansion works differently from Lisp conventions",
         "(open)",
         "<https://github.com/hylang/hy/issues/180>"])
    actual = g.get_github_issue(None, None, "180", dry_run=True)
    assert expected == actual


def test_get_github_commit():
    expected = " ".join(
        ["Commit", "3e8941c", "on", "hylang/hy", "by",
         "<NAME>:",
         "Convert stdout and stderr to UTF-8 properly in the run_cmd helper.",
         "<https://github.com/hylang/hy" +
         "/commit/3e8941cdde01635890db524c4789f0640fe665c3>"])
    actual = g.get_github_commit(None, None, "3e8941c", dry_run=True)
    assert expected == actual


def test_get_core_members():
    expected = "Core Team consists of: " + \
               ", ".join(["<NAME>", "<NAME>",
                          "<NAME>", "<NAME>",
                          "<NAME>", "khinsen",
                          "<NAME>", "<NAME>",
                          "<NAME>", "<NAME>",
                          "<NAME>", "<NAME>"])
    actual = g.get_core_members(None, None, dry_run=True)
    assert actual == expected
{'fraction_non_alphanumeric': 0.15739570164348926, 'fraction_numerical': 0.03034134007585335, 'mean_word_length': 2.29002079002079, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 4, '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': '4361779', 'n_tokens_mistral': 1048, 'n_tokens_neox': 999, 'n_words': 223}