tout
This commit is contained in:
förälder
7726bdc2ab
incheckning
1911a4f913
5 ändrade filer med 62 tillägg och 10 borttagningar
0
YOLO/Dockerfiles/app/app/images/TEST.png
Executable file → Normal file
0
YOLO/Dockerfiles/app/app/images/TEST.png
Executable file → Normal file
Före Bredd: | Höjd: | Storlek: 1,6 MiB Efter Bredd: | Höjd: | Storlek: 1,6 MiB |
18
YOLO/Dockerfiles/app/app/test.py
Normal file
18
YOLO/Dockerfiles/app/app/test.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import unittest
|
||||
|
||||
class UnitTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
import app
|
||||
app = app.create_app()
|
||||
app.testing = True
|
||||
self.app = app.test_client()
|
||||
|
||||
def test_yolo(self):
|
||||
rv = self.app.get('/create/TEST/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
self.assertEqual(rv.data,b'5')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
|
@ -1,4 +1,4 @@
|
|||
import unittest
|
||||
import unittest,json
|
||||
|
||||
class UnitTest(unittest.TestCase):
|
||||
|
||||
|
@ -9,19 +9,20 @@ class UnitTest(unittest.TestCase):
|
|||
self.app = app.test_client()
|
||||
|
||||
def test_create(self):
|
||||
rv = self.app.get('/create/TEST')
|
||||
self.assertEqual(rv.status, '308 PERMANENT REDIRECT')
|
||||
rv = self.app.get('/create/TEST/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
self.assertEqual(rv.data,b'1')
|
||||
|
||||
def test_question(self):
|
||||
rv = self.app.get('/question/1')
|
||||
self.assertEqual(rv.status, '308 PERMANENT REDIRECT')
|
||||
self.assertEqual(rv.data,b'1')
|
||||
|
||||
rv = self.app.get('/question/1/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
self.assertEqual(rv.data,b'{"attribut": "Smiling", "intitule": "Is the person smiling?", "response": "Yes;No"}')
|
||||
|
||||
def test_update(self):
|
||||
rv = self.app.get('/update/TEST/Bald/1')
|
||||
self.assertEqual(rv.status,'308 PERMANENT REDIRECT')
|
||||
self.assertEqual(rv.data,b'1')
|
||||
rv = self.app.get('/update/TEST/Smiling/1/')
|
||||
self.assertEqual(rv.status,'200 OK')
|
||||
n = json.loads(rv.data)['Nb']
|
||||
self.assertEqual(n,19)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
16
grid-generation/Dockerfiles/app/app/test.py
Normal file
16
grid-generation/Dockerfiles/app/app/test.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
import unittest
|
||||
|
||||
class UnitTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
import app
|
||||
app = app.create_app()
|
||||
app.testing = True
|
||||
self.app = app.test_client()
|
||||
|
||||
def test_c(self):
|
||||
rv = self.app.get('/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
17
update/Dockerfiles/app/app/test.py
Normal file
17
update/Dockerfiles/app/app/test.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import unittest
|
||||
|
||||
class UnitTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
import app
|
||||
app = app.create_app()
|
||||
app.testing = True
|
||||
self.app = app.test_client()
|
||||
|
||||
def test_create(self):
|
||||
rv = self.app.get('/update/TEST/bald/1/')
|
||||
self.assertEqual(rv.status, '200 OK')
|
||||
self.assertEqual(rv.data,b'12')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Laddar…
Referens i nytt ärende