test_winmnt.py 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. '''
  2. Created on Jan 29, 2020 @author: deeejas
  3. '''
  4. import unittest
  5. import pandas as pd
  6. from winmentor import info_anaf
  7. from winmentor.dbread import WinMentor
  8. from winmentor.mentorutils import Mentorutils
  9. class Test(unittest.TestCase):
  10. mentor = WinMentor()
  11. utils = Mentorutils()
  12. @unittest.skip('reason')
  13. def test_check_list(self):
  14. info_anaf.check_list('lista_cf.txt')
  15. def test_utils(self):
  16. headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Obs']
  17. n_headers = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Obs',
  18. 'TurnO', 'Result', 'divid', 'divid_current', 'spons', 'month']
  19. mentor = WinMentor()
  20. utils = Mentorutils()
  21. office = mentor.filtered_firmlist('/firme.db', headers=headers)
  22. utils.gen_turnover('./generated_files/turn_over', 'to', office, m_month='2019_12', n_headers=n_headers)
  23. def test_get_bank_accounts(self):
  24. for account in self.mentor.get_bank_accounts('WEBS'):
  25. # if account[2].startswith(' '):
  26. print(account)
  27. def test_get_oblig(self):
  28. head = ['Denumire', 'CF', 'J', 'Adresa', 'Oras', 'Judet', 'Prescurtat', 'Admin', 'AdminP', 'RCNP', 'Obs']
  29. # firm_list = list(self.mentor.filtered_firmlist(head))
  30. df_dicts = self.mentor.get_oblig('KINVEST')
  31. df = pd.DataFrame(df_dicts[0])
  32. df2 = pd.DataFrame(df_dicts[1])
  33. df3 = pd.merge(df, df2, how='left', left_on='Part', right_on='Cod')
  34. df3.drop(columns=['Part', 'Cod'], inplace=True)
  35. print(df3.head(10))
  36. df3.to_excel('obligatii.xlsx')
  37. if __name__ == "__main__":
  38. unittest.main()