<commit_before>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import climenu


def test_black():
    climenu.colors.black('test')


def test_red():
    climenu.colors.red('test')


def test_green():
    climenu.colors.green('test')


def test_yellow():
    climenu.colors.yellow('test')


def test_blue():
    climenu.colors.blue('test')


def test_magenta():
    climenu.colors.magenta('test')


def test_cyan():
    climenu.colors.cyan('test')


def test_white():
    climenu.colors.white('test')


def test_disable():
    climenu.settings.disable_colors = True
    climenu.colors.black('test')<commit_msg>adding more tests for colors<commit_after>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from __future__ import print_function
import climenu


def test_all_colors():
    fg_code = '[3'
    bg_code = '[4'

    for color in ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']:
        for bg in [True, False]:
            for bright in [True, False]:
                func = getattr(climenu.colors, color)
                value = func(text='testing', bg=bg, bright=bright)
                assert value.startswith('\033')
                assert 'testing\033' in value
                if bg:
                    assert bg_code in value
                else:
                    assert fg_code in value


def test_black():
    assert climenu.colors.black('test')


def test_red():
    assert climenu.colors.red('test')


def test_green():
    assert climenu.colors.green('test')


def test_yellow():
    assert climenu.colors.yellow('test')


def test_blue():
    assert climenu.colors.blue('test')


def test_magenta():
    assert climenu.colors.magenta('test')


def test_cyan():
    assert climenu.colors.cyan('test')


def test_white():
    assert climenu.colors.white('test')


def test_disable():
    climenu.settings.disable_colors = True
    assert climenu.colors.black('test') == 'test'
{'fraction_non_alphanumeric': 0.1416155419222904, 'fraction_numerical': 0.006134969325153374, 'mean_word_length': 2.898406374501992, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2982381', 'n_tokens_mistral': 652, 'n_tokens_neox': 627, 'n_words': 142}