<commit_before># -*- coding: utf-8 -*-
from unittest import TestCase


class TestOneAll(TestCase):
    def test_whether_test_runs(self):
        self.assertTrue(True)<commit_msg>Test suite is taking shape. :)<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase, main

from pyoneall import OneAll
from pyoneall.classes import BadOneAllCredentials, Connections


class TestOneAll(TestCase):
    VALID_CREDENTIALS = {
        'site_name': 'python',
        'public_key': '2d27cffd-1ced-4991-83d1-acce715461e5',
        # I really hope this doesn't Jynx my accounts.
        'private_key': '<KEY>',
    }

    INVALID_CREDENTIALS = {
        'site_name': 'python',
        'public_key': '<KEY>',
        'private_key': '<KEY>',
    }

    def test_00_whether_test_runs(self):
        self.assertTrue(True)

    def test_01_users_list(self):
        auth = OneAll(**self.VALID_CREDENTIALS)
        c = auth.connections()
        self.assertIsInstance(c, Connections)

    def test_02_bad_credentials(self):
        auth = OneAll(**self.INVALID_CREDENTIALS)
        with self.assertRaises(BadOneAllCredentials):
            auth.connections()

    def dont_test_03_swapped_credentials(self):
        kwargs = dict(self.VALID_CREDENTIALS)
        kwargs['private_key'], kwargs['public_key'] = kwargs['public_key'], kwargs['private_key']
        auth = OneAll(**kwargs)
        # How should this result be different from test 02?
        with self.assertRaises(BadOneAllCredentials):
            auth.connections()


if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.11313868613138686, 'fraction_numerical': 0.01824817518248175, 'mean_word_length': 3.2950391644908614, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1025477', 'n_tokens_mistral': 537, 'n_tokens_neox': 512, 'n_words': 108}