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
21f3ac13
Commit
21f3ac13
authored
5 years ago
by
morkolai
Browse files
Options
Downloads
Patches
Plain Diff
#52 Test for fylling av data og format
parent
95467582
No related branches found
Branches containing commit
No related tags found
1 merge request
!27
#52 Automatisk oppdatering av kodebok basert på tid
Pipeline
#73855
passed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/test_database.py
+10
-0
10 additions, 0 deletions
test/test_database.py
with
10 additions
and
0 deletions
test/test_database.py
+
10
−
0
View file @
21f3ac13
...
...
@@ -105,6 +105,16 @@ class DatabaseTest(unittest.TestCase):
self
.
assertRegex
(
actual
[
i
][
2
],
"
[A-Z]{
"
+
str
(
code_len
)
+
"
}
"
)
self
.
assertEqual
(
entry
[
"
type
"
],
actual
[
i
][
3
])
def
test_last_updated
(
self
):
"""
Assert table LastUpdated is filled when db is created.
"""
stmt
=
"
SELECT Timestamp FROM LastUpdated
"
# [:19] to skip microseconds
last_update
=
self
.
database
.
conn
.
execute
(
stmt
).
fetchall
()[
0
][
0
][:
19
]
# Using raw string to not make backslash escape character
self
.
assertRegex
(
last_update
,
r
"
(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})
"
)
def
test_get_categories
(
self
):
"""
Assert function get_categories works as expected.
"""
file_path
=
os
.
path
.
join
(
TESTDATA_PATH
,
"
CategoryWords.txt
"
)
...
...
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