Ejemplo n.º 1
0
 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()  
Ejemplo n.º 2
0
 def setUp(self):
     self.app = app.test_client()
     self.app.testing = True
Ejemplo n.º 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)
Ejemplo n.º 4
0
 def __init__(self):
     self.master_test_setup()
     self.app = app.test_client()
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 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)
Ejemplo n.º 9
0
 def setUp(self):
     self.app = app.test_client()