test_anafapi.py 966 B

123456789101112131415161718192021222324252627282930313233343536
  1. '''Created Dec 6, 2021 Levi'''
  2. import unittest
  3. from winmentor.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. print(self.api.get_rep(cui='17259191', year='2020')[1])
  11. def test_get_vat(self):
  12. print(self.api.get_vat('17259191'))
  13. def test_get_cult(self):
  14. print(self.api.get_cult('29422330'))
  15. def test_to_excel_rep(self):
  16. self.api.to_excel('to_rep', cui=['17259191'], func=self.api.get_rep, range_='2018-2019')
  17. self.api.open()
  18. def test_to_excel_vat(self):
  19. self.api.to_excel('to_vat', cui=utils.gen_txt(), func=self.api.get_vat)
  20. def test_to_excel_cult(self):
  21. self.api.to_excel('to_cult', cui=['29422330'], func=self.api.get_cult)
  22. self.api.open()
  23. if __name__ == "__main__":
  24. #import sys;sys.argv = ['', 'Test.testName']
  25. unittest.main()