Skip to content
Snippets Groups Projects
Commit 8e8e998b authored by Anders H. Rebner's avatar Anders H. Rebner
Browse files

#58 Endret test til å reflektere tabellstruktur

parent e3d9ca87
No related branches found
No related tags found
1 merge request!33#58 Lag PDF med kode- og dekodebok
Pipeline #74602 failed
......@@ -13,4 +13,4 @@ class CodebookSort(Enum):
"""Enumerate with ways to sort codebook."""
WORD = 0
CODE = 1
\ No newline at end of file
CODE = 1
......@@ -3,6 +3,7 @@ import os
from pathlib import Path
import unittest
import json
from soitool.enumerates import CodebookSize
from soitool.database import Database
from soitool.coder import get_code_length_needed
......@@ -102,8 +103,8 @@ class DatabaseTest(unittest.TestCase):
for i, entry in enumerate(expected):
self.assertEqual(entry["word"], actual[i][0])
self.assertEqual(entry["category"], actual[i][1])
self.assertRegex(actual[i][3], "[A-Z]{" + str(code_len) + "}")
self.assertEqual(entry["type"], actual[i][2])
self.assertRegex(actual[i][3], "[A-Z]{" + str(code_len) + "}")
def test_get_categories(self):
"""Assert function get_categories works as expected."""
......@@ -161,7 +162,7 @@ class DatabaseTest(unittest.TestCase):
if entry["type"] == 1:
expected.append(entry)
# Get small codebook from db
actual = self.database.get_codebook(small=True)
actual = self.database.get_codebook(codebook_size=CodebookSize.FULL)
# Compare lenght
self.assertEqual(len(expected), len(actual))
# Get expected length of codes
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment