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

import reactor_bot

import datetime
from freezegun import freeze_time

class TestReactorBot:

	def test_extract_emoji(self):
		lines_and_emojis = {
			' M)-ystery meat': 'M',
			'🐕 dog sandwiches': '🐕',
			'3 blind mice': '3',
			'🇺🇸 flags': '🇺🇸',
			'<:python3:232720527448342530> python3!': '<:python3:232720527448342530>',
		}
	
		for input, output in lines_and_emojis.items():
			assert reactor_bot.extract_emoji(input) == output
	
	
	def test_emojify(self):
		# custom emoji extraction is the only feature unique to emojify()
		# so we'll test the other functionality in other tests
		assert reactor_bot.emojify('<:python3:232720527448342530>') == ':python3:232720527448342530'
	
		assert reactor_bot.emojify('asdfghjkl;') == 'asdfghjkl;'
	
	
	def test_get_letter_emoji(self):
		io_map = {
			'A': '🇦',
			'B': '🇧',
			'C': '🇨',
			'D': '🇩',
			'E': '🇪',
			'F': '🇫',
			'G': '🇬',
			'H': '🇭',
			'I': '🇮',
			'J': '🇯',
			'K': '🇰',
			'L': '🇱',
			'M': '🇲',<commit_msg>tests.test_emojify: add lots more tests<commit_after>#!/usr/bin/env python3

import reactor_bot

import datetime
from freezegun import freeze_time

class TestReactorBot:

	def test_extract_emoji(self):
		lines_and_emojis = {
			' M)-ystery meat': 'M',
			'🐕 dog sandwiches': '🐕',
			'3 blind mice': '3',
			'🇺🇸 flags': '🇺🇸',
			'<:python3:232720527448342530> python3!': '<:python3:232720527448342530>',
		}

		for input, output in lines_and_emojis.items():
			assert reactor_bot.extract_emoji(input) == output


	def test_emojify(self):
		assert reactor_bot.emojify('<:python3:232720527448342530>') == ':python3:232720527448342530'
		assert reactor_bot.emojify('a') == '🇦'
		# this one's wonky--sometimes we return invalid emoji,
		# but that's ok, because Discord throws them out with an error ;)
		assert reactor_bot.emojify('123') == '123⃣'
		assert reactor_bot.emojify('0') == '0⃣'
		assert reactor_bot.emojify('6') == '6⃣'
		assert reactor_bot.emojify('asdfghjkl;') == 'asdfghjkl;'


	def test_get_letter_emoji(self):
		io_map = {
			'A': '🇦',
			'B': '🇧',
			'C': '🇨',
			'D': '🇩',
			'E': '🇪',
			'F': '🇫',
			'G': '🇬',
			'H': '🇭',
			'I': '🇮',
			'J': '🇯',
			'K': '🇰',
			'L': '🇱',
			'M': '🇲',
{'fraction_non_alphanumeric': 0.20333633904418394, 'fraction_numerical': 0.07664562669071236, 'mean_word_length': 4.031746031746032, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2819420', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1006, 'n_words': 206}