def upload_project(client, auth, email='*****@*****.**', file='no_files.json'): token = auth.get_token(email=email) json_file = load_json_file(file, 'test_files/projects') return client.post('/projects/', headers={'Authorization': 'Bearer ' + token}, json=json_file)
def add_comment(client, auth, project_id, email='*****@*****.**', comment_file='comment.json'): token = auth.get_token(email=email) json_comment = load_json_file(comment_file, 'test_files/comments') return client.post('/comments/{}/'.format(project_id), headers={'Authorization': 'Bearer ' + token}, json=json_comment)
def modify_project(client, auth, email, project_id, file): token = auth.get_token(email=email) json_file = load_json_file(file, 'test_files/projects/modify_projects') return client.patch('/projects/{}/'.format(project_id), headers={'Authorization': 'Bearer ' + token}, json=json_file)
def delete_project(client, auth, email, project_id): token = auth.get_token(email=email) return client.delete('/projects/{}/'.format(project_id), headers={'Authorization': 'Bearer ' + token})
def get_projects(client, auth, email='*****@*****.**'): token = auth.get_token(email=email) return client.get('/projects/', headers={'Authorization': 'Bearer ' + token})
def delete_comment(client, auth, comment_id, email='*****@*****.**'): token = auth.get_token(email=email) return client.delete('/comments/{}/'.format(comment_id), headers={'Authorization': 'Bearer ' + token})
def get_comments(client, auth, project_id, email='*****@*****.**'): token = auth.get_token(email=email) return client.get('/comments/{}/'.format(project_id), headers={'Authorization': 'Bearer ' + token})