Esempio n. 1
0
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)
Esempio n. 2
0
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)
Esempio n. 3
0
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)
Esempio n. 4
0
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})
Esempio n. 5
0
def get_projects(client, auth, email='*****@*****.**'):
    token = auth.get_token(email=email)
    return client.get('/projects/',
                      headers={'Authorization': 'Bearer ' + token})
Esempio n. 6
0
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})
Esempio n. 7
0
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})