<commit_before>import unittest
import os
import binascii
import blocktrail


class ApiClientTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(self):
        self.cleanup_data = {};

    def tearDown(self):
        #cleanup any records that were created after each test
        client = self.setup_api_client(debug=False)

        #webhooks
        if 'webhooks' in self.cleanup_data:
            count = 0
            for webhook in self.cleanup_data['webhooks']:
                try:
                    count += int(client.delete_webhook(webhook))
                except Exception:
                    pass
            print "\ncleanup - %d webhooks deleted\n" % (count)

    def setup_api_client(self, api_key="MY_APIKEY", api_secret="MY_APISECRET", debug=True):
        return blocktrail.APIClient(api_key, api_secret, debug=debug)

    def test_coin_value(self):
        assert 1 == blocktrail.to_satoshi(0.00000001)
        assert 1.0, blocktrail.to_btc(100000000)

        assert 123456789, blocktrail.to_satoshi(1.23456789)
        assert 1.23456789, blocktrail.to_btc(123456789)
    
    def test_auth(self):
        client = self.setup_api_client(api_secret="FAILSECRET", debug=False)

        assert client.address("1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp")

        with self.assertRaises(blocktrail.exceptions.InvalidCredentials):
            client.verify_address("16dwJmR4mX5RguGrocMfN9Q9FR2kZcLw2z", "<KEY>
<commit_msg>removed unnecesary print from test and changed setUpClass to setUp<commit_after>import unittest
import os
import binascii
import blocktrail


class ApiClientTestCase(unittest.TestCase):
    def setUp(self):
        self.cleanup_data = {}

    def tearDown(self):
        #cleanup any records that were created after each test
        client = self.setup_api_client(debug=False)

        #webhooks
        if 'webhooks' in self.cleanup_data:
            count = 0
            for webhook in self.cleanup_data['webhooks']:
                try:
                    count += int(client.delete_webhook(webhook))
                except Exception:
                    pass

    def setup_api_client(self, api_key="MY_APIKEY", api_secret="MY_APISECRET", debug=True):
        return blocktrail.APIClient(api_key, api_secret, debug=debug)

    def test_coin_value(self):
        assert 1 == blocktrail.to_satoshi(0.00000001)
        assert 1.0, blocktrail.to_btc(100000000)

        assert 123456789, blocktrail.to_satoshi(1.23456789)
        assert 1.23456789, blocktrail.to_btc(123456789)
    
    def test_auth(self):
        client = self.setup_api_client(api_secret="FAILSECRET", debug=False)

        assert client.address("1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp")

        with self.assertRaises(blocktrail.exceptions.InvalidCredentials):
            client.verify_address("16dwJmR4mX5RguGrocMfN9Q9FR2kZcLw2z", "<KEY>

{'fraction_non_alphanumeric': 0.08654519971969166, 'fraction_numerical': 0.050455501051156273, 'mean_word_length': 2.858108108108108, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '4299711', 'n_tokens_mistral': 1025, 'n_tokens_neox': 924, 'n_words': 170}