mirror of
https://github.com/lucaspalomodevelop/Party.git
synced 2026-03-13 00:07:21 +00:00
poetry
This commit is contained in:
commit
f57f08eab0
38
endpoints.json
Normal file
38
endpoints.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"endpoints": [
|
||||
"/api": [
|
||||
{
|
||||
"/mate": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"method":"GET"
|
||||
},
|
||||
{
|
||||
"endpoint": "/status",
|
||||
"method":"GET"
|
||||
},
|
||||
{
|
||||
"endpoint": "/trinken",
|
||||
"method":"POST"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"/chat": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"method":"GET"
|
||||
},
|
||||
{
|
||||
"endpoint": "/messages:count",
|
||||
"method": "GET"
|
||||
},
|
||||
{
|
||||
"endpoint": "/new",
|
||||
"method": "POST"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
4
party/__init__.py
Normal file
4
party/__init__.py
Normal file
@ -0,0 +1,4 @@
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__,
|
||||
template_folder='templates')
|
||||
14
pyproject.toml
Normal file
14
pyproject.toml
Normal file
@ -0,0 +1,14 @@
|
||||
[tool.poetry]
|
||||
name = "party"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["hyperbel <hyperbel@users.noreply.github.com>"]
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
8
tests/__init__.py
Normal file
8
tests/__init__.py
Normal file
@ -0,0 +1,8 @@
|
||||
import pytest
|
||||
from party import app
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
#app.config['TESTING'] = True
|
||||
client = app.test_client()
|
||||
yield client
|
||||
23
tests/test_party.py
Normal file
23
tests/test_party.py
Normal file
@ -0,0 +1,23 @@
|
||||
from test import client
|
||||
|
||||
def test_api(client):
|
||||
endpoints = [("/api", "GET"),
|
||||
("/api/mate", "GET"),
|
||||
("/api/mate/status", "GET"),
|
||||
("/api/mate/trinken", "POST"),
|
||||
("/api/chat/", "GET"),
|
||||
("/api/chat/messages/:count", "GET"),
|
||||
("/api/chat/new_message", "POST"),
|
||||
("/api/music", "GET"),
|
||||
("/api/music/skip", "POST"),
|
||||
("/api/music/queue", "GET"),
|
||||
("/api/music/add_song", "POST")
|
||||
]
|
||||
response = client.get('/api')
|
||||
|
||||
for endpoint in endpoints:
|
||||
if endpoint[1] == "GET":
|
||||
response = client.get(endpoint[0])
|
||||
elif endpoint[1] == "POST":
|
||||
response = client.post(endpoint[0])
|
||||
assert response.status_code == 200
|
||||
Loading…
x
Reference in New Issue
Block a user