rewrite stuff

This commit is contained in:
hyperbel 2023-07-04 20:56:15 +02:00
parent 07cad08237
commit e73f5bbc02
56 changed files with 87 additions and 14 deletions

View File

@ -1,14 +0,0 @@
# Party Controller
Dies ist eine Software für Lan Partys
## Server starten
+ Clonen `git clone https://github.com/fingadumbledore/Party`
### Nativ:
+ Wechseln`cd Party`
+ starten`./run.sh`
### Mit Nix
+ `nix-shell`
+ `bash run.sh`

38
endpoints.json Normal file
View 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"
}
]
}
]
]
}

14
old/README.md Normal file
View File

@ -0,0 +1,14 @@
# Party Controller
Dies ist eine Software für Lan Partys
## Server starten
+ Clonen `git clone https://github.com/fingadumbledore/Party`
### Nativ:
+ Wechseln`cd Party`
+ starten`./run.sh`
### Mit Nix
+ `nix-shell`
+ `bash run.sh`

View File

View File

View File

Before

Width:  |  Height:  |  Size: 235 KiB

After

Width:  |  Height:  |  Size: 235 KiB

View File

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

Before

Width:  |  Height:  |  Size: 230 KiB

After

Width:  |  Height:  |  Size: 230 KiB

View File

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 449 B

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
party/.coverage Normal file

Binary file not shown.

4
party/__init__.py Normal file
View File

@ -0,0 +1,4 @@
from flask import Flask
app = Flask(__name__,
template_folder='templates')

0
party/main.py Normal file
View File

0
setup.py Normal file
View File

8
test/__init__.py Normal file
View 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
test/test_server.py Normal file
View 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