test_anafapi.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. '''Created Dec 6, 2021 Levi'''
  2. import unittest
  3. from anafapi.anafapi import anafAPI
  4. # from winmentor import Mentorutils
  5. # utils = Mentorutils()
  6. # print(utils.gen_txt())
  7. class Test(unittest.TestCase):
  8. api = anafAPI()
  9. def test_get_rep(self):
  10. rep = self.api.get_rep(cui='17259191', year='2020')
  11. print(rep[0])
  12. def test_get_vat(self):
  13. print(self.api.get_vat('28298293'))
  14. def test_get_cult(self):
  15. print(self.api.get_cult('29422330'))
  16. def test_to_excel_rep(self):
  17. self.api.to_excel('to_rep', cui=['28298293'], func=self.api.get_rep, range_='2015-2020')
  18. self.api.open()
  19. def test_to_excel_vat(self):
  20. self.api.to_excel('to_vat', cui=['28298293'], func=self.api.get_vat)
  21. def test_to_excel_cult(self):
  22. self.api.to_excel('to_cult', cui=['29422330'], func=self.api.get_cult)
  23. self.api.open()
  24. def test_process_rep(self):
  25. print(self.api.process_resp())
  26. if __name__ == "__main__":
  27. unittest.main()
  28. # Test().test_get_vat()
  29. # Test().test_process_rep()