<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from unittest2 import TestCase
import afp_cli.cli_functions as cli
from datetime import datetime


class CliFunctionsTest(TestCase):
    def setUp(self):
        pass

    def tearDown(self):
        pass

    def test_format_aws_credentials_with_prefix(self):
        credentials = {"AWS_ACCESS_KEY_ID": "testAccessKey"}
        self.assertEqual(cli.format_aws_credentials(credentials),
                         "AWS_ACCESS_KEY_ID='testAccessKey'")

        self.assertEqual(cli.format_aws_credentials(credentials, prefix='export '),
                         "export AWS_ACCESS_KEY_ID='testAccessKey'")

        self.assertEqual(cli.format_aws_credentials(credentials, prefix='set '),
                         "set AWS_ACCESS_KEY_ID='testAccessKey'")

    def test_format_aws_credentials_multline(self):
        input_ = {"AWS_ACCESS_KEY_ID": "testAccessKey",
                  "AWS_SECRET_ACCESS_KEY": "not so secret"}

        self.assertEqual(cli.format_aws_credentials(input_),
                         "AWS_ACCESS_KEY_ID='testAccessKey'\nAWS_SECRET_ACCESS_KEY='not so secret'")

    def test_get_valid_seconds(self):
        self.assertEqual(cli.get_valid_seconds('2016-08-16T07:45:00Z', datetime(2016, 8, 16, hour=7, minute=15)),
                         30*60)

    def test_format_account_and_one_role(self):
        self.assertEqual(cli.format_account_and_role_list({"testaccount1": ["testrole1"]}),
                         "testaccount1         testrole1")

    def test_format_account_and_two_roles(self):
        self.assertEqual(cli.format_account_and_role_list({"testaccount2": ["testrole1", "testrole2"]}),
                         "testaccount2         testrole1,testrole2")
<commit_msg>don't need a setUp and tearDown if pass<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from unittest2 import TestCase
import afp_cli.cli_functions as cli
from datetime import datetime


class CliFunctionsTest(TestCase):

    def test_format_aws_credentials_with_prefix(self):
        credentials = {"AWS_ACCESS_KEY_ID": "testAccessKey"}
        self.assertEqual(cli.format_aws_credentials(credentials),
                         "AWS_ACCESS_KEY_ID='testAccessKey'")

        self.assertEqual(cli.format_aws_credentials(credentials, prefix='export '),
                         "export AWS_ACCESS_KEY_ID='testAccessKey'")

        self.assertEqual(cli.format_aws_credentials(credentials, prefix='set '),
                         "set AWS_ACCESS_KEY_ID='testAccessKey'")

    def test_format_aws_credentials_multline(self):
        input_ = {"AWS_ACCESS_KEY_ID": "testAccessKey",
                  "AWS_SECRET_ACCESS_KEY": "not so secret"}

        self.assertEqual(cli.format_aws_credentials(input_),
                         "AWS_ACCESS_KEY_ID='testAccessKey'\nAWS_SECRET_ACCESS_KEY='not so secret'")

    def test_get_valid_seconds(self):
        self.assertEqual(cli.get_valid_seconds('2016-08-16T07:45:00Z', datetime(2016, 8, 16, hour=7, minute=15)),
                         30*60)

    def test_format_account_and_one_role(self):
        self.assertEqual(cli.format_account_and_role_list({"testaccount1": ["testrole1"]}),
                         "testaccount1         testrole1")

    def test_format_account_and_two_roles(self):
        self.assertEqual(cli.format_account_and_role_list({"testaccount2": ["testrole1", "testrole2"]}),
                         "testaccount2         testrole1,testrole2")

{'fraction_non_alphanumeric': 0.10579128440366972, 'fraction_numerical': 0.022935779816513763, 'mean_word_length': 3.0335260115606935, 'pattern_counts': {'":': 10, '<': 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': '922112', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1048, 'n_words': 149}