Add updated documentation and tests

This commit is contained in:
Tim Schubert 2018-08-23 13:04:28 +02:00
parent bd910e09e0
commit 5576b58949
15 changed files with 63 additions and 29 deletions

View file

@ -1,14 +0,0 @@
#!/bin/sh
for d in $(cat abgaben.txt)
do
time=$(echo $d | cut -d',' -f1)
tag=$(echo $d | cut -d',' -f2)
now=$(date --iso-8601)
if [[ "$time" < "$now" ]] || [[ "$time" = "$now" ]]
then
git tag ${tag}
git push --tags
fi
done

View file

@ -1,13 +0,0 @@
#!/bin/sh
set -eu
read -p "Enter a name for the exercise (used for tag name): " exercise_name
read -p "Are you sure you want to create a new tag? This will cause a new tag to be created in each student project and run JPlag on the solutions. [N/y]: " cont
if [ ${cont} == 'y' ] || [ ${cont} == 'Y' ]
then
git tag "${exercise_name}"
git push --tag
fi

View file

@ -14,7 +14,7 @@
# #
import os import os
import sys import sys
sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('../src'))
# -- Project information ----------------------------------------------------- # -- Project information -----------------------------------------------------

View file

@ -22,5 +22,14 @@ Indices and tables
.. automodule:: abgabesystem .. automodule:: abgabesystem
:members: :members:
.. autoclass:: abgabesystem.Student .. automodule:: abgabesystem.projects
:members:
.. automodule:: abgabesystem.students
:members:
.. automodule:: abgabesystem.commands
:members:
.. autoclass:: abgabesystem.students.Student
:members: :members:

2
setup.cfg Normal file
View file

@ -0,0 +1,2 @@
[aliases]
test=pytest

1
tests/.#test_students.py Symbolic link
View file

@ -0,0 +1 @@
tim@metis.680:1534753335

0
tests/__init.py__ Normal file
View file

8
tests/test_auth.py Normal file
View file

@ -0,0 +1,8 @@
import gitlab
def auth(config="/tmp/python-gitlab.cfg"):
gl = gitlab.Gitlab.from_config(config_files=[config])
gl.auth()
return gl

27
tests/test_commands.py Normal file
View file

@ -0,0 +1,27 @@
import gitlab
from abgabesystem.commands import create_users, projects, deadline, plagiates, course
gl = gitlab.Gitlab.from_config()
gl.auth()
def test_create_users():
pass
def test_courses():
pass
def test_projects():
pass
def test_deadlines():
pass
def test_plagiates():
pass

0
tests/test_projects.py Normal file
View file

0
tests/test_students.py Normal file
View file

14
tox.ini Normal file
View file

@ -0,0 +1,14 @@
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py37
[testenv]
deps =
pytest
python-gitlab
commands =
pytest