diff --git a/README.md b/README.md index df4b2e0..e69de29 100644 --- a/README.md +++ b/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` diff --git a/endpoints.json b/endpoints.json new file mode 100644 index 0000000..85754a0 --- /dev/null +++ b/endpoints.json @@ -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" + } + ] + } + ] + ] +} diff --git a/Config/README.md b/old/Config/README.md similarity index 100% rename from Config/README.md rename to old/Config/README.md diff --git a/Config/log/README.md b/old/Config/log/README.md similarity index 100% rename from Config/log/README.md rename to old/Config/log/README.md diff --git a/Config/mate.json b/old/Config/mate.json similarity index 100% rename from Config/mate.json rename to old/Config/mate.json diff --git a/Config/party.sql b/old/Config/party.sql similarity index 100% rename from Config/party.sql rename to old/Config/party.sql diff --git a/old/README.md b/old/README.md new file mode 100644 index 0000000..df4b2e0 --- /dev/null +++ b/old/README.md @@ -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` diff --git a/database.py b/old/database.py similarity index 100% rename from database.py rename to old/database.py diff --git a/endpoints.txt b/old/endpoints.txt similarity index 100% rename from endpoints.txt rename to old/endpoints.txt diff --git a/log.py b/old/log.py similarity index 100% rename from log.py rename to old/log.py diff --git a/main.py b/old/main.py similarity index 100% rename from main.py rename to old/main.py diff --git a/mate.py b/old/mate.py similarity index 100% rename from mate.py rename to old/mate.py diff --git a/musik.py b/old/musik.py similarity index 100% rename from musik.py rename to old/musik.py diff --git a/picker.py b/old/picker.py similarity index 100% rename from picker.py rename to old/picker.py diff --git a/requirements.txt b/old/requirements.txt similarity index 100% rename from requirements.txt rename to old/requirements.txt diff --git a/run.sh b/old/run.sh similarity index 100% rename from run.sh rename to old/run.sh diff --git a/server.py b/old/server.py similarity index 100% rename from server.py rename to old/server.py diff --git a/static/css/create_session.css b/old/static/css/create_session.css similarity index 100% rename from static/css/create_session.css rename to old/static/css/create_session.css diff --git a/static/css/login.css b/old/static/css/login.css similarity index 100% rename from static/css/login.css rename to old/static/css/login.css diff --git a/static/css/style.css b/old/static/css/style.css similarity index 100% rename from static/css/style.css rename to old/static/css/style.css diff --git a/static/img/Balloons.png b/old/static/img/Balloons.png similarity index 100% rename from static/img/Balloons.png rename to old/static/img/Balloons.png diff --git a/static/img/house.png b/old/static/img/house.png similarity index 100% rename from static/img/house.png rename to old/static/img/house.png diff --git a/static/img/party.png b/old/static/img/party.png similarity index 100% rename from static/img/party.png rename to old/static/img/party.png diff --git a/static/img/qrcode.png b/old/static/img/qrcode.png similarity index 100% rename from static/img/qrcode.png rename to old/static/img/qrcode.png diff --git a/static/img/user.png b/old/static/img/user.png similarity index 100% rename from static/img/user.png rename to old/static/img/user.png diff --git a/static/js/chat.js b/old/static/js/chat.js similarity index 100% rename from static/js/chat.js rename to old/static/js/chat.js diff --git a/static/js/control.js b/old/static/js/control.js similarity index 100% rename from static/js/control.js rename to old/static/js/control.js diff --git a/static/js/create_session.js b/old/static/js/create_session.js similarity index 100% rename from static/js/create_session.js rename to old/static/js/create_session.js diff --git a/static/js/game.js b/old/static/js/game.js similarity index 100% rename from static/js/game.js rename to old/static/js/game.js diff --git a/static/js/general.js b/old/static/js/general.js similarity index 100% rename from static/js/general.js rename to old/static/js/general.js diff --git a/static/js/login.js b/old/static/js/login.js similarity index 100% rename from static/js/login.js rename to old/static/js/login.js diff --git a/static/js/logout.js b/old/static/js/logout.js similarity index 100% rename from static/js/logout.js rename to old/static/js/logout.js diff --git a/statistik.py b/old/statistik.py similarity index 100% rename from statistik.py rename to old/statistik.py diff --git a/templates/404.html b/old/templates/404.html similarity index 100% rename from templates/404.html rename to old/templates/404.html diff --git a/templates/changeSession.html b/old/templates/changeSession.html similarity index 100% rename from templates/changeSession.html rename to old/templates/changeSession.html diff --git a/templates/createSession.html b/old/templates/createSession.html similarity index 100% rename from templates/createSession.html rename to old/templates/createSession.html diff --git a/templates/index.html b/old/templates/index.html similarity index 100% rename from templates/index.html rename to old/templates/index.html diff --git a/templates/login.html b/old/templates/login.html similarity index 100% rename from templates/login.html rename to old/templates/login.html diff --git a/templates/logout.html b/old/templates/logout.html similarity index 100% rename from templates/logout.html rename to old/templates/logout.html diff --git a/templates/messages.html b/old/templates/messages.html similarity index 100% rename from templates/messages.html rename to old/templates/messages.html diff --git a/templates/passwd.html b/old/templates/passwd.html similarity index 100% rename from templates/passwd.html rename to old/templates/passwd.html diff --git a/templates/session.html b/old/templates/session.html similarity index 100% rename from templates/session.html rename to old/templates/session.html diff --git a/templates/spiel.html b/old/templates/spiel.html similarity index 100% rename from templates/spiel.html rename to old/templates/spiel.html diff --git a/test.py b/old/test.py similarity index 100% rename from test.py rename to old/test.py diff --git a/test/main.py b/old/test/main.py similarity index 100% rename from test/main.py rename to old/test/main.py diff --git a/test/templates/index.html b/old/test/templates/index.html similarity index 100% rename from test/templates/index.html rename to old/test/templates/index.html diff --git a/upload/Dateien/README.md b/old/upload/Dateien/README.md similarity index 100% rename from upload/Dateien/README.md rename to old/upload/Dateien/README.md diff --git a/upload/Musik/README.md b/old/upload/Musik/README.md similarity index 100% rename from upload/Musik/README.md rename to old/upload/Musik/README.md diff --git a/upload/README.md b/old/upload/README.md similarity index 100% rename from upload/README.md rename to old/upload/README.md diff --git a/upload/Spielstand/README.md b/old/upload/Spielstand/README.md similarity index 100% rename from upload/Spielstand/README.md rename to old/upload/Spielstand/README.md diff --git a/party/.coverage b/party/.coverage new file mode 100644 index 0000000..8adc4e8 Binary files /dev/null and b/party/.coverage differ diff --git a/party/__init__.py b/party/__init__.py new file mode 100644 index 0000000..fc66062 --- /dev/null +++ b/party/__init__.py @@ -0,0 +1,4 @@ +from flask import Flask + +app = Flask(__name__, + template_folder='templates') diff --git a/party/main.py b/party/main.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e69de29 diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..80d6ec7 --- /dev/null +++ b/test/__init__.py @@ -0,0 +1,8 @@ +import pytest +from party import app + +@pytest.fixture +def client(): + #app.config['TESTING'] = True + client = app.test_client() + yield client diff --git a/test/test_server.py b/test/test_server.py new file mode 100644 index 0000000..ea99b78 --- /dev/null +++ b/test/test_server.py @@ -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