summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdev.sh35
-rw-r--r--pyproject.toml11
-rw-r--r--tests/test_enemies.py8
3 files changed, 36 insertions, 18 deletions
diff --git a/dev.sh b/dev.sh
index 9bee2dc..c4125ed 100755
--- a/dev.sh
+++ b/dev.sh
@@ -1,23 +1,27 @@
#!/bin/sh
[ x$1 = x ] && echo "\
-Pieni ja kevyt skripti helppoa kehitystyökalujen ajoa varten.
+Small script for running developement tools.
-Käyttö: $0 <komento>
+Usage: $0 <command>
-Komennot:
+Commands:
-dev Asenna devausymäristö
-pytest Aja yksikkötestit pytestillä
-pylint Tarkista muotoilu pylintillä
-covhtml Tee haarakattavuus raportti html muodossa
-covxml Sama mutta xml muoto (codecov tarvitsee tämän)
-covff Tee html haarakattavuusraportti ja avaa se firefoxissa
-all Sama kuin '$0 covff && $0 pylint'
-install Rakenna ja asenna paketti käyttäen pipx & poetry
+dev Install developement envoronment
+pytest Run pytest unittests
+pylint Do pylint
+covhtml Make branch coverage report in html format
+covff Open html coverage report in firefox
+all Do it all: pytest, coverage report in firefox and pylint
+install Build poetry package and install it for current user
" && exit 0
-[ x$PIP = x ] && PIP="pipx"
+PIP=`which pipx`
+[ x$PIP = x ] && PIP=`which pip`
+[ x$PIP = x ] \
+ && echo "This scripts needs pipx or pip to install dependencies." \
+ && exit 1
+
export DEVSH_PRIN=">>$DEVSH_PRIN"
export DEVSH_PROUT="<<$DEVSH_PROUT"
@@ -49,7 +53,7 @@ case $1 in
;;
pylint)
- poetry run python3 -m pylint src/miinaharava/
+ poetry run python3 -m pylint src/sliceitoff/
;;
coverage)
@@ -61,11 +65,6 @@ case $1 in
&& poetry run python3 -m coverage html
;;
- covxml)
- $0 coverage \
- && poetry run python3 -m coverage xml
- ;;
-
covff)
$0 covhtml \
&& firefox htmlcov/index.html
diff --git a/pyproject.toml b/pyproject.toml
index 483d69f..f6ab331 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -19,3 +19,14 @@ coverage = "^7.4.4"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
+
+[tool.poetry.scripts]
+miinaharava = 'sliceitoff.main:main'
+
+[tool.pytest.ini_options]
+pythonpath = [ "src/sliceitoff" ]
+
+
+[tool.pylint.main]
+recursive = true
+source-roots = ["src/sliceitoff"]
diff --git a/tests/test_enemies.py b/tests/test_enemies.py
new file mode 100644
index 0000000..24c608c
--- /dev/null
+++ b/tests/test_enemies.py
@@ -0,0 +1,8 @@
+import unittest
+
+from enemies.enemies import EnemySprite
+
+class TestEnemySprite(unittest.TestCase):
+ def test_can_create(self):
+ enemy = EnemySprite()
+ self.assertNotEqual(None, enemy)