error_101_test.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import unittest
  2. import base64
  3. from pathlib import Path
  4. import requests
  5. from testing.utils import *
  6. class TestBank101(unittest.TestCase):
  7. def _helper(self, image_path, sta):
  8. root = Path(__file__).parent
  9. image_path = str(root / image_path)
  10. r = send_request(image_path)
  11. self.assertEqual(sta, r['status'], f'{image_path} status case error')
  12. def test_error_03(self):
  13. image_path = '../images/error/101_error/03.png'
  14. self._helper(image_path, '000')
  15. def test_error_04(self):
  16. image_path = '../images/error/101_error/04.png'
  17. self._helper(image_path, '000')
  18. def test_error_05(self):
  19. image_path = '../images/error/101_error/05.png'
  20. r = send_request(image_path)
  21. self.assertEqual(r['status'], '000', 'status case error')
  22. def test_error_06(self):
  23. image_path = '../images/error/101_error/06.png'
  24. self._helper(image_path, '000')
  25. def test_error_08(self):
  26. image_path = '../images/error/101_error/08.png'
  27. self._helper(image_path, '000')
  28. def test_error_10(self):
  29. image_path = '../images/error/101_error/10.png'
  30. self._helper(image_path, '000')
  31. def test_error_11(self):
  32. image_path = '../images/error/101_error/11.png'
  33. self._helper(image_path, '000')