Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
soitool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bachelor-paa-bittet
soitool
Commits
8e8e998b
Commit
8e8e998b
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#58 Endret test til å reflektere tabellstruktur
parent
e3d9ca87
No related branches found
Branches containing commit
No related tags found
1 merge request
!33
#58 Lag PDF med kode- og dekodebok
Pipeline
#74602
failed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
soitool/enumerates.py
+1
-1
1 addition, 1 deletion
soitool/enumerates.py
test/test_database.py
+3
-2
3 additions, 2 deletions
test/test_database.py
with
4 additions
and
3 deletions
soitool/enumerates.py
+
1
−
1
View file @
8e8e998b
...
...
@@ -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
This diff is collapsed.
Click to expand it.
test/test_database.py
+
3
−
2
View file @
8e8e998b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment