rewrite stuff
14
README.md
@ -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
@ -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
@ -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`
|
||||
|
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 235 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
BIN
party/.coverage
Normal file
4
party/__init__.py
Normal file
@ -0,0 +1,4 @@
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__,
|
||||
template_folder='templates')
|
||||
0
party/main.py
Normal file
8
test/__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
test/test_server.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
|
||||