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
99990a27
Commit
99990a27
authored
5 years ago
by
Anders H. Rebner
Browse files
Options
Downloads
Patches
Plain Diff
#68 test_database.py sletter database-fil mellom hver test, nå fungerer testene
parent
188cad3f
No related branches found
Branches containing commit
No related tags found
1 merge request
!43
#68 Kodebok-oppdatering gjennom GUI og lagre databaseendringer
Pipeline
#76824
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
+8
-1
8 additions, 1 deletion
test/test_database.py
with
8 additions
and
1 deletion
test/test_database.py
+
8
−
1
View file @
99990a27
...
...
@@ -5,7 +5,7 @@ import unittest
import
json
from
time
import
sleep
from
datetime
import
datetime
from
soitool.database
import
Database
from
soitool.database
import
Database
,
DBPATH
from
soitool.coder
import
get_code_length_needed
TESTDATA_PATH
=
Path
(
__file__
).
parent
.
parent
/
"
soitool/testdata
"
...
...
@@ -17,6 +17,7 @@ class DatabaseTest(unittest.TestCase):
def
setUp
(
self
):
"""
Connect to/create database.
"""
self
.
database
=
Database
()
self
.
addCleanup
(
self
.
delete_db
)
def
test_connection
(
self
):
"""
Assert connection is not None.
"""
...
...
@@ -288,6 +289,12 @@ class DatabaseTest(unittest.TestCase):
]
self
.
assertRegex
(
code
,
"
[A-Z0-9]
"
)
def
delete_db
(
self
):
"""
Delete generated db-file.
"""
del
self
.
database
if
os
.
path
.
exists
(
DBPATH
):
os
.
remove
(
DBPATH
)
if
__name__
==
"
__main__
"
:
unittest
.
main
()
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