Exemplo n.º 1
0
 def testing_calculate_square(self):
     tester = app.test_client(self)
     response = tester.get('/getsquare')
     self.assertTrue(b'perimeter' in response.data)
Exemplo n.º 2
0
 def test_response1(self):
     tester = app.test_client(self)
     response = tester.get('/')
     statuscode = response.status_code
     self.assertEqual(statuscode, 200)
Exemplo n.º 3
0
 def testing_calculate_circle(self):
     tester = app.test_client(self)
     response = tester.get('/getcircle')
     self.assertTrue(b'circumference' in response.data)
Exemplo n.º 4
0
 def testing_home_page(self):
     tester = app.test_client(self)
     response = tester.get('/')
     self.assertTrue(b'Hello' in response.data)
Exemplo n.º 5
0
 def test_content_length(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     temp = json.loads(response.data)['measurements']
     self.assertGreater(len(temp), 0, msg='Not Populated')
Exemplo n.º 6
0
 def test_content_data(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     self.assertTrue(b'shape' in response.data)
Exemplo n.º 7
0
 def test_content_type(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     print(response.content_type)
     self.assertEqual(response.content_type, 'application/json')