<commit_before>import unittest
import datetime
import json
import sys

sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions

'''
requires config.json in the same directory for api authentication

{
	"sabre_client_id": -----,
	"sabre_client_secret": -----
}

'''
class TestBasicLeadPrice(unittest.TestCase):
    def read_config(self):
        raw_data = open('config.json').read()

        data = json.loads(raw_data)

        client_secret = data['sabre_client_secret']
        client_id = data['sabre_client_id']

        return (client_id, client_secret)

    def setUp(self):
        # Read from config
        self.client_id, self.client_secret = self.read_config()
        self.sds = sabre_dev_studio.SabreDevStudio()
        self.sds.set_credentials(self.client_id, self.client_secret)
        self.sds.authenticate()

    def test_request_with_args(self):
        prices = self.sds.lead_price('YTO', 'SFO', [3,4])

        self.assertIsNotNone(prices)

    def test_basic_request(self):
        opts = {
            'origin': 'YTO',
            'destination': 'SFO',
            'lengthofstay': [3,4]
        }

        prices = self.sds.lead_price_opts(opts)

        self.assertIsNotNone(prices)
        

if __name__ == '__main__':
    unittest.main()
<commit_msg>Add point of sale country to lead price tests<commit_after>import unittest
import datetime
import json
import sys

sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions

'''
requires config.json in the same directory for api authentication

{
	"sabre_client_id": -----,
	"sabre_client_secret": -----
}

'''
class TestBasicLeadPrice(unittest.TestCase):
    def read_config(self):
        raw_data = open('config.json').read()

        data = json.loads(raw_data)

        client_secret = data['sabre_client_secret']
        client_id = data['sabre_client_id']

        return (client_id, client_secret)

    def setUp(self):
        # Read from config
        self.client_id, self.client_secret = self.read_config()
        self.sds = sabre_dev_studio.SabreDevStudio()
        self.sds.set_credentials(self.client_id, self.client_secret)
        self.sds.authenticate()

    def test_request_with_args(self):
        prices = self.sds.lead_price('YTO', 'SFO', [3,4], point_of_sale='CA')

        self.assertIsNotNone(prices)

    def test_basic_request(self):
        opts = {
            'origin': 'YTO',
            'destination': 'SFO',
            'lengthofstay': [3,4],
            'pointofsalecountry': 'CA'
        }

        prices = self.sds.lead_price_opts(opts)

        self.assertIsNotNone(prices)
        

if __name__ == '__main__':
    unittest.main()

{'fraction_non_alphanumeric': 0.11863173216885008, 'fraction_numerical': 0.002911208151382824, 'mean_word_length': 2.871830985915493, 'pattern_counts': {'":': 4, '<': 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': '4408632', 'n_tokens_mistral': 938, 'n_tokens_neox': 915, 'n_words': 165}