-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #22 #23
Merged
Merged
Fix #22 #23
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7dec852
Fix #22
AronBuzogany 4477216
Merge branch 'development' into backend/feature/root-endpoint
AronBuzogany b7a9d44
moved endpoint tests to seperate folder
AronBuzogany cb62692
added test to test if required field of openapi root object are present
AronBuzogany 922fa0f
added init file to support multi level module referencing
AronBuzogany d301807
Merge branch 'development' into backend/feature/root-endpoint
AronBuzogany 7f099c0
linting: fixed
AronBuzogany d18d982
linting: multi-line function docs ender on his own
AronBuzogany c3dd7b4
linting: function docs should use 3 quatation marks
AronBuzogany File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "Pigeonhole API", | ||
"summary": "A project submission and grading API for University Ghent students and professors.", | ||
"description": "The API built for the Pigeonhole application. It serves as an interface for student of University Ghent. They can submit solutions to projects created by their professors. Professors and their assistents can then review these submitions, grade them and define custom tests that automatically run on every submition. The API is built using the OpenAPI 3.1.0 specification.", | ||
"version": "1.0.0", | ||
"contact": { | ||
"name": "Project discussion forum", | ||
"url": "https://github.com/SELab-2/UGent-opgave/discussions", | ||
"email": "Bart.Coppens@UGent.be" | ||
}, | ||
"x-authors": [ | ||
{ | ||
"name": "Aron Buzogany", | ||
"github": "https://github.com/AronBuzogany" | ||
}, | ||
{ | ||
"name": "Gerwoud Van den Eynden", | ||
"github": "https://github.com/Gerwoud" | ||
}, | ||
{ | ||
"name": "Jarne Clauw", | ||
"github": "https://github.com/JarneClauw" | ||
}, | ||
{ | ||
"name": "Siebe Vlietinck", | ||
"github": "https://github.com/Vucis" | ||
}, | ||
{ | ||
"name": "Warre Provoost", | ||
"github": "https://github.com/warreprovoost" | ||
}, | ||
{ | ||
"name": "Cedric Mekeirle", | ||
"github": "https://github.com/JibrilExe" | ||
}, | ||
{ | ||
"name": "Matisse Sulzer", | ||
"github": "https://github.com/Matisse-Sulzer" | ||
} | ||
] | ||
}, | ||
"paths": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Index api point""" | ||
import os | ||
from flask import Blueprint, send_from_directory | ||
from flask_restful import Resource, Api | ||
|
||
index_bp = Blueprint("index", __name__) | ||
index_endpoint = Api(index_bp) | ||
|
||
class Index(Resource): | ||
"""Api endpoint for the / route""" | ||
|
||
def get(self): | ||
""" | ||
Example of an api endpoint function that will respond to get requests made to | ||
return a json data structure with key Message and value Hello World! | ||
""" | ||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
return send_from_directory(dir_path, "OpenAPI_Object.json") | ||
|
||
|
||
index_bp.add_url_rule("/", view_func=Index.as_view("index")) |
Empty file.
File renamed without changes.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docstring of test_openapi_spec only contains 1 " instead of 3 " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"""Test the base routes of the application""" | ||
|
||
def test_home(client): | ||
"""Test whether the index page is accesible""" | ||
response = client.get("/") | ||
assert response.status_code == 200 | ||
|
||
def test_openapi_spec(client): | ||
"""Test whether the required fields of the openapi spec are present""" | ||
response = client.get("/") | ||
response_json = response.json | ||
assert response_json["openapi"] is not None | ||
assert response_json["info"] is not None |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last """ of docstring shouldn't contain text