import unittest import pandas as pd from gcstruct.gchr import GCHR, TRANSLATE class TestGchr(unittest.TestCase): base_dir_1: str = "C:\\Projekte\\GCHR2_Testdaten\\Kunden\\Altermann" base_dir_2: str = "C:\\Projekte\\GCHR2_Testdaten\\Kunden\\Koenig-und-Partner" def test_single_booking_files(self): gchr = GCHR(self.base_dir_1) self.assertEqual(len(gchr.account_bookings), 1) self.assertEqual(gchr.account_bookings[0].name, "GuV_Bilanz_Salden.csv") def test_multiple_booking_files(self): gchr = GCHR(self.base_dir_2) self.assertEqual(len(gchr.account_bookings), 2) self.assertEqual(gchr.account_bookings[0].name, "GuV_Bilanz_Salden.csv") self.assertEqual(gchr.account_bookings[1].name, "GuV_Bilanz_Salden_deop03.csv") def test_translation_existing(self): gchr = GCHR(self.base_dir_1) df = gchr.df_translate self.assertIsInstance(df, pd.DataFrame) self.assertEqual(df.shape[1], 12) self.assertListEqual(list(df.columns), TRANSLATE) self.assertGreater(df.shape[0], 0, "Translation not empty")