コード例 #1
0
 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')
コード例 #2
0
 def test_response1(self):
     tester = app.test_client(self)
     response = tester.get('/')
     statuscode = response.status_code
     self.assertEqual(statuscode, 200)
コード例 #3
0
    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')
コード例 #4
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')
コード例 #5
0
 def test_content_data(self):
     tester = app.test_client(self)
     response = tester.get('/io')
     self.assertTrue(b'id' in response.data)