test_doc.py 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from tracim_backend.tests import FunctionalTest
  2. class TestDoc(FunctionalTest):
  3. def test_api__check_doc_index_html_page__ok_200__nominal_case(self):
  4. res = self.testapp.get('/api/v2/doc/', status=200)
  5. assert res.content_type == 'text/html'
  6. def test_api__check_spec_yaml_file__ok_200__nominal_case(self):
  7. res = self.testapp.get('/api/v2/doc/spec.yml', status=200)
  8. assert res.content_type == 'text/x-yaml'
  9. def test_api__check_docs_assets__ok_200__nominal_case(self):
  10. res = self.testapp.get(
  11. '/api/v2/doc/favicon-32x32.png',
  12. status=200,
  13. )
  14. assert res.content_type == 'image/png'
  15. res = self.testapp.get(
  16. '/api/v2/doc/favicon-16x16.png',
  17. status=200
  18. )
  19. assert res.content_type == 'image/png'
  20. res = self.testapp.get(
  21. '/api/v2/doc/swagger-ui.js',
  22. status=200
  23. )
  24. assert res.content_type == 'application/javascript'
  25. res = self.testapp.get(
  26. '/api/v2/doc/swagger-ui-standalone-preset.js',
  27. status=200
  28. )
  29. assert res.content_type == 'application/javascript'
  30. res = self.testapp.get(
  31. '/api/v2/doc/swagger-ui-bundle.js',
  32. status=200
  33. )
  34. assert res.content_type == 'application/javascript'
  35. res = self.testapp.get(
  36. '/api/v2/doc/swagger-ui.css',
  37. status=200
  38. )
  39. assert res.content_type == 'text/css'