''' Created on Jan 29, 2020 @author: deeejas ''' import unittest import pandas as pd from winmentor import info_anaf from winmentor.dbread import WinMentor from winmentor.mentorutils import Mentorutils class Test(unittest.TestCase): mentor = WinMentor() utils = Mentorutils() @unittest.skip('reason') def test_check_list(self): info_anaf.check_list('lista_cf.txt') def test_utils(self): headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Obs'] n_headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Obs', 'TurnO', 'Result', 'divid', 'divid_current', 'spons', 'month'] mentor = WinMentor() utils = Mentorutils() office = mentor.filtered_firmlist('/firme.db', headers=headers) utils.gen_turnover('./generated_files/turn_over', 'to', office, m_month='2019_12', n_headers=n_headers) def test_get_bank_accounts(self): for account in self.mentor.get_bank_accounts('WEBS'): # if account[2].startswith(' '): print(account) def test_get_oblig(self): head = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs'] # firm_list = list(self.mentor.filtered_firmlist(head)) df_dicts = self.mentor.get_oblig('KINVEST') df = pd.DataFrame(df_dicts[0]) df2 = pd.DataFrame(df_dicts[1]) df3 = pd.merge(df, df2, how='left', left_on='Part', right_on='Cod') df3.drop(columns=['Part', 'Cod'], inplace=True) print(df3.head(10)) df3.to_excel('obligatii.xlsx') if __name__ == "__main__": unittest.main()