def test_content_type(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     print('ssss===================')
     print(response.content_type)
     #self.assertEqual(response.content_type, 'text/plain')
     #self.assertEqual(response.content_type, 'application/octet-stream')
     self.assertEqual(response.content_type, 'application/json')
 def test_response1(self):
     tester = app.test_client(self)
     response = tester.get('/')
     statuscode = response.status_code
     self.assertEqual(statuscode, 200)
    def test_content_length(self):
        tester = app.test_client(self)
        response = tester.get('/io')
        temp = json.loads(response.data)['tasks']

        self.assertGreater(len(temp), 0, msg='Not Populated')
 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')
示例#5
0
 def test_content_data(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     self.assertTrue(b'id' in response.data)