<commit_before>import unittest

try:
    from mock import patch
except ImportError:
    from unittest.mock import patch

from quickbooks.tools.auth import QuickBooksAuthServer


class ClientTest(unittest.TestCase):

    def setUp(self):
        self.consumer_key = 'update_consumer_key'
        self.consumer_secret = 'update_consumer_secret'
        self.sandbox = True
        self.port = 8080
        self.authorize_url = '{}?oauth_token=testToken'.format(
            QuickBooksAuthServer.qb_client_class.authorize_url)

    def test_build_server(self):
        with patch.object(QuickBooksAuthServer.qb_client_class,
                          'get_authorize_url',
                          return_value=self.authorize_url):
            server = QuickBooksAuthServer.build_server(
                self.consumer_key, self.consumer_secret,<commit_msg>fix string format at python 2.6<commit_after>import unittest

try:
    from mock import patch
except ImportError:
    from unittest.mock import patch

from quickbooks.tools.auth import QuickBooksAuthServer


class ClientTest(unittest.TestCase):

    def setUp(self):
        self.consumer_key = 'update_consumer_key'
        self.consumer_secret = 'update_consumer_secret'
        self.sandbox = True
        self.port = 8080
        self.authorize_url = '{0}?oauth_token=testToken'.format(
            QuickBooksAuthServer.qb_client_class.authorize_url)

    def test_build_server(self):
        with patch.object(QuickBooksAuthServer.qb_client_class,
                          'get_authorize_url',
                          return_value=self.authorize_url):
            server = QuickBooksAuthServer.build_server(
                self.consumer_key, self.consumer_secret,
{'fraction_non_alphanumeric': 0.07130434782608695, 'fraction_numerical': 0.006376811594202898, 'mean_word_length': 2.7440347071583515, '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': '218772', 'n_tokens_mistral': 520, 'n_tokens_neox': 481, 'n_words': 88}