Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bline
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Software Public
PASSOFT
bline
Commits
379f9725
Commit
379f9725
authored
3 years ago
by
Omid Hosseini
Browse files
Options
Downloads
Patches
Plain Diff
Add the structure of the unittest to util module
parent
8585862e
Branches
feature-modularize_bline
No related tags found
No related merge requests found
Pipeline
#1058
failed with stage
Stage: test
in 45 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bline/baler_addr/test/test_util.py
+58
-0
58 additions, 0 deletions
bline/baler_addr/test/test_util.py
bline/baler_addr/util.py
+4
-3
4 additions, 3 deletions
bline/baler_addr/util.py
with
62 additions
and
3 deletions
bline/baler_addr/test/test_util.py
+
58
−
0
View file @
379f9725
import
unittest
from
unittest.mock
import
patch
from
baler_addr
import
util
class
TestUtil
(
unittest
.
TestCase
):
@classmethod
def
setUpClass
(
cls
)
->
None
:
print
(
'
setupClass.
'
)
@classmethod
def
tearDownClass
(
cls
)
->
None
:
print
(
'
teardownClass.
'
)
def
setUp
(
self
)
->
None
:
print
(
'
setup.
'
)
pass
def
tearDown
(
self
)
->
None
:
print
(
'
teardown.
\n
'
)
pass
def
test_retrieve_baler_dir_list
(
self
):
pass
def
test_clear_baler_status
(
self
):
pass
def
test_retrieve_baler_thrd_status
(
self
):
pass
def
test_retrieve_baler_status
(
self
):
pass
def
test_retrieve_baler_info
(
self
):
pass
def
test_find_occur
(
self
):
pass
def
test_get_htm
(
self
):
pass
def
test_check_tags
(
self
):
pass
def
test_query_yes_no
(
self
):
pass
def
test_user_decision_tags
(
self
):
pass
def
test_mkdir_p
(
self
):
pass
This diff is collapsed.
Click to expand it.
bline/baler_addr/util.py
+
4
−
3
View file @
379f9725
...
@@ -282,8 +282,8 @@ def user_decision_tags(missing_tags, extra_tags):
...
@@ -282,8 +282,8 @@ def user_decision_tags(missing_tags, extra_tags):
# The user has entered tagIDs that don't match with the identified
# The user has entered tagIDs that don't match with the identified
# ones. Report them and ask for the proper action.
# ones. Report them and ask for the proper action.
if
len
(
missing_tags
)
!=
0
:
if
len
(
missing_tags
)
!=
0
:
logger
.
warning
(
"
Devices with the following tag(s), %s, not identified
"
logger
.
warning
(
"
Devices with the following tag(s), %s, not identified
"
,
,
missing_tags
)
missing_tags
)
print
(
"
Baler(s) with following tag(s), %s, have not been
"
print
(
"
Baler(s) with following tag(s), %s, have not been
"
"
addressed. (Not connected perhaps!).
"
%
missing_tags
)
"
addressed. (Not connected perhaps!).
"
%
missing_tags
)
if
query_yes_no
(
"
Would you like to connect the Baler(s) with the
"
if
query_yes_no
(
"
Would you like to connect the Baler(s) with the
"
...
@@ -315,7 +315,8 @@ def mkdir_p(path):
...
@@ -315,7 +315,8 @@ def mkdir_p(path):
except
TypeError
:
except
TypeError
:
try
:
try
:
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
except
OSError
as
exc
:
# Python >2.5
# Python > 2.5
except
OSError
as
exc
:
if
exc
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
if
exc
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
path
):
pass
pass
else
:
else
:
...
...
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