<commit_before>#!/usr/bin/env python
# I don't know how to use Mock or pytest so this is the best test I can think
# of. It works if you run it alongside a configured taiga-back install.

import sys
from configparser import RawConfigParser

# Locate taiga-back libs
sys.path.append('../taiga-back/')

from taiga_contrib_ad_auth import connector

conf_defaults = {
    'DEFAULT': {
        'username': '<EMAIL>',
        'password': '<PASSWORD>.'
    }
}

config = RawConfigParser(defaults=conf_defaults)
config.readfp(open('tests/tests_local.cfg'))

def test_ad_login_success():
    (email, username) = connector.login(
        config.get('DEFAULT', 'username'),
        config.get('DEFAULT', 'password')
    )


if __name__ == '__main__':
    test_ad_login_success()
<commit_msg>better output<commit_after>#!/usr/bin/env python
# I don't know how to use Mock or pytest so this is the best test I can think
# of. It works if you run it alongside a configured taiga-back install.

import sys
from configparser import RawConfigParser

# Locate taiga-back libs
sys.path.append('../taiga-back/')

from taiga_contrib_ad_auth import connector

conf_defaults = {
    'DEFAULT': {
        'username': '<EMAIL>',
        'password': '<PASSWORD>.'
    }
}

config = RawConfigParser(defaults=conf_defaults)
config.readfp(open('tests/tests_local.cfg'))

def test_ad_login_success():
    (email, username) = connector.login(
        config.get('DEFAULT', 'username'),
        config.get('DEFAULT', 'password')
    )

    print('Success: {email}, {username}'.format(
        email=email,
        username=username
    ))


if __name__ == '__main__':
    test_ad_login_success()

{'fraction_non_alphanumeric': 0.12740384615384615, 'fraction_numerical': 0.0, 'mean_word_length': 3.6769662921348316, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2929337', 'n_tokens_mistral': 533, 'n_tokens_neox': 524, 'n_words': 142}