コード例 #1
0
ファイル: test.py プロジェクト: liubbn/flask_web
 def setUp(self):
     #unittest.TestCase.setUp(self)
     app.config['TESTING']=True
     app.config['CSRF_ENABLED'] = False
     app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(basedir, 'test.db')
     self.app = app.test_client()
     db.create_all()  
コード例 #2
0
ファイル: test_playlistr.py プロジェクト: Gan0k/Playlistr
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
コード例 #3
0
 def test_G1_delete_ride(self):
     tester = app.test_client(self)
     response = tester.delete('/api/v1/rides/{rideId}'.format(rideId=1))
     self.assertEqual(response.status_code,200)
コード例 #4
0
ファイル: setup_tests.py プロジェクト: rioscesar/Plunjr-API
 def __init__(self):
     self.master_test_setup()
     self.app = app.test_client()
コード例 #5
0
 def test_B1_insert_user(self):
     tester = app.test_client(self)
     info = {"username":"******", "password":"******"} 
     response = tester.put('/api/v1/users', data=json.dumps(info), headers={'Content-Type': 'application/json'})
     self.assertEqual(response.status_code,201)
コード例 #6
0
 def test_F3_join_ride(self):
     tester = app.test_client(self)
     info = {"username":"******"}
     response = tester.post('/api/v1/rides/{rideId}'.format(rideId=999),data=json.dumps(info),headers={'Content-Type': 'application/json'})
     self.assertEqual(response.status_code,400)
コード例 #7
0
 def test_E2_given_ride(self):
     tester = app.test_client(self)
     response = tester.get('/api/v1/rides/{rideId}'.format(rideId=999))
     self.assertEqual(response.status_code,204)
コード例 #8
0
 def test_D6_list_rides(self):
     tester = app.test_client(self)
     response = tester.get('/api/v1/rides?source={source}&destination={destination}'.format(source=3,destination=0))
     self.assertEqual(response.status_code,400)
コード例 #9
0
ファイル: test_basics.py プロジェクト: eugen1701/flask_cl
 def setUp(self):
     self.app = app.test_client()