<commit_before>import os
import unittest

import autoqm.utils 

class TestAuthentication(unittest.TestCase):

	cfg_path = os.path.join('data', 'test_config.cfg')

	def test_read_config(self):

		config = autoqm.utils.read_config(self.cfg_path)

		self.assertIn('ThermoCentralDatabase', config)
		self.assertIn('TCD_HOST', config['ThermoCentralDatabase'])
		self.assertIn('TCD_PORT', config['ThermoCentralDatabase'])
		self.assertIn('TCD_USER', config['ThermoCentralDatabase'])
		self.assertIn('TCD_PW', config['ThermoCentralDatabase'])

		self.assertEqual(config['ThermoCentralDatabase']['TCD_HOST'], 'my_host')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_PORT'], '123')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_USER'], 'me')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_PW'], 'secret')

	def test_get_TCD_authentication_info(self):

		host, port, username, password = autoqm.utils.get_TCD_authentication_info(self.cfg_path)

		self.assertEqual(host, 'my_host')<commit_msg>adds absolute path for testing robustness<commit_after>import os
import unittest

import autoqm.utils 

class TestAuthentication(unittest.TestCase):

	cfg_path = os.path.join(os.path.dirname(__file__), 'data', 'test_config.cfg')

	def test_read_config(self):

		config = autoqm.utils.read_config(self.cfg_path)

		self.assertIn('ThermoCentralDatabase', config)
		self.assertIn('TCD_HOST', config['ThermoCentralDatabase'])
		self.assertIn('TCD_PORT', config['ThermoCentralDatabase'])
		self.assertIn('TCD_USER', config['ThermoCentralDatabase'])
		self.assertIn('TCD_PW', config['ThermoCentralDatabase'])

		self.assertEqual(config['ThermoCentralDatabase']['TCD_HOST'], 'my_host')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_PORT'], '123')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_USER'], 'me')
		self.assertEqual(config['ThermoCentralDatabase']['TCD_PW'], 'secret')

	def test_get_TCD_authentication_info(self):

		host, port, username, password = autoqm.utils.get_TCD_authentication_info(self.cfg_path)

		self.assertEqual(host, 'my_host')
{'fraction_non_alphanumeric': 0.14492055849783342, 'fraction_numerical': 0.002888781896966779, 'mean_word_length': 8.665116279069768, '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': '307214', 'n_tokens_mistral': 750, 'n_tokens_neox': 644, 'n_words': 89}