Selaa lähdekoodia

Add test for swagger_ui doc

Guénaël Muller 6 vuotta sitten
vanhempi
commit
9e91b5b1fb
1 muutettua tiedostoa jossa 44 lisäystä ja 0 poistoa
  1. 44 0
      tracim/tests/functional/test_doc.py

+ 44 - 0
tracim/tests/functional/test_doc.py Näytä tiedosto

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