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
b4ce9664
Commit
b4ce9664
authored
5 years ago
by
tholok97
Browse files
Options
Downloads
Patches
Plain Diff
#4 bandit also on test, pycodestyle also on test
parent
487f0782
No related branches found
No related tags found
No related merge requests found
Pipeline
#70398
failed
5 years ago
Stage: lint
Stage: test
Stage: deploy
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+2
-2
2 additions, 2 deletions
.gitlab-ci.yml
test/__init__.py
+1
-0
1 addition, 0 deletions
test/__init__.py
test/test_main.py
+7
-8
7 additions, 8 deletions
test/test_main.py
with
10 additions
and
10 deletions
.gitlab-ci.yml
+
2
−
2
View file @
b4ce9664
...
...
@@ -22,14 +22,14 @@ job_lint_bandit:
image
:
morkolai/soitool-ci
script
:
-
bandit --version
-
bandit -r soitool
-
bandit -r soitool
test
job_lint_pydocstyle
:
stage
:
lint
image
:
morkolai/soitool-ci
script
:
-
pydocstyle --version
-
pydocstyle --convention=numpy soitool
-
pydocstyle
--match '.*.py'
--convention=numpy soitool
test
job_test_gui_ubuntu_vnc
:
stage
:
test
...
...
This diff is collapsed.
Click to expand it.
test/__init__.py
+
1
−
0
View file @
b4ce9664
"""
Tester koden vår.
"""
This diff is collapsed.
Click to expand it.
test/test_main.py
+
7
−
8
View file @
b4ce9664
"""
Test CoolWidget
"""
"""
Test CoolWidget
.
"""
import
unittest
import
sys
...
...
@@ -23,7 +23,7 @@ app = QtWidgets.QApplication(sys.argv)
def
wait
(
msec
):
"""
Venter msec millisekunder
"""
Venter msec millisekunder
.
Bruker https://stackoverflow.com/a/34745326/3545896
...
...
@@ -32,24 +32,23 @@ def wait(msec):
msec : number
msec to wait
"""
end
=
datetime_
.
now
()
+
timedelta
(
milliseconds
=
msec
)
while
datetime_
.
now
()
<
end
:
app
.
processEvents
()
class
TestMain
(
unittest
.
TestCase
):
"""
TestCase for main
"""
"""
TestCase for main
.
"""
def
setUp
(
self
):
"""
Forbereder widget for testing
"""
"""
Forbereder widget for testing
.
"""
self
.
test_text1
=
"
A bad boy
"
self
.
test_text2
=
"
Hei Anders!
"
self
.
widget
=
main
.
CoolWidget
(
self
.
test_text1
)
self
.
widget
.
show
()
def
test_starts_up
(
self
):
"""
Test at widget kan starte opp
"""
"""
Test at widget kan starte opp
.
"""
self
.
assertEqual
(
self
.
widget
.
qlabel
.
text
(),
self
.
test_text1
,
...
...
@@ -57,7 +56,7 @@ class TestMain(unittest.TestCase):
self
.
assertTrue
(
self
.
widget
.
isVisible
())
def
test_change_text_ok
(
self
):
"""
Test at endring av tekst funker
"""
"""
Test at endring av tekst funker
.
"""
def
change_text_and_ok
():
while
self
.
widget
.
dlg_input
is
None
:
...
...
@@ -75,7 +74,7 @@ class TestMain(unittest.TestCase):
)
def
test_change_text_not_ok
(
self
):
"""
Test at avbrytelse av endring av tekster ikke endrer tekst
"""
"""
Test at avbrytelse av endring av tekster ikke endrer tekst
.
"""
def
accept_popup
():
QtTest
.
QTest
.
keyClick
(
app
.
activeModalWidget
(),
QtCore
.
Qt
.
Key_Enter
)
...
...
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