summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-13 21:01:55 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-13 21:01:55 +0200
commitb12c97653c2ee004292b0fdfd770a2c59451854b (patch)
tree558d86421b118290ab68743785fd84e6208b17cd /tests
parent30ee34f106c5052cf0a60361d3220427b5753557 (diff)
Linting rest of the files and adding pylint to GHA.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_board.py15
-rw-r--r--tests/test_noop.py2
2 files changed, 10 insertions, 7 deletions
diff --git a/tests/test_board.py b/tests/test_board.py
index 8fa2fa3..9acc39f 100644
--- a/tests/test_board.py
+++ b/tests/test_board.py
@@ -1,16 +1,22 @@
+"""test_board.py - Testit pelilaudalle"""
+
import unittest
from board.board import Board
class TestBoardClass(unittest.TestCase):
+ """ pelilauden testit"""
def test_init(self):
+ """ olion luominen onnistuu """
b = Board()
self.assertTrue(b.size>0)
-
+
def test_init_with_size(self):
+ """ olion luominen onnistuu tietyllä koolla"""
b = Board(15)
self.assertEqual(b.size, 15)
-
+
def test_get_view_and_make_guess(self):
+ """ laudan näkymä on oikein senkin jälkeen kun on arvattu"""
b = Board(3)
b.tiles=[[0,0,0],[0,1,1],[0,1,9]]
@@ -18,13 +24,12 @@ class TestBoardClass(unittest.TestCase):
t = [[10,10,10],[10,10,10],[10,10,10]]
for i in range(3):
self.assertEqual(v[i],t[i])
-
+
self.assertTrue(b.make_guess(0,0))
v = b.get_view()
t = [[0,0,0],[0,1,1],[0,1,10]]
for i in range(3):
self.assertEqual(v[i],t[i])
-
+
self.assertFalse(b.make_guess(2,2))
-
\ No newline at end of file
diff --git a/tests/test_noop.py b/tests/test_noop.py
deleted file mode 100644
index 61de3a2..0000000
--- a/tests/test_noop.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def test_noop():
- pass