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()
def setUp(self): self.app = app.test_client() self.app.testing = True
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)
def __init__(self): self.master_test_setup() self.app = app.test_client()
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)
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)
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)
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)
def setUp(self): self.app = app.test_client()