Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
757be2f9
Commit
757be2f9
authored
Jan 28, 2021
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented coverage for semantic-linking and business-logic
parent
4c39d6b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
168 additions
and
0 deletions
+168
-0
test_coverage.py
...ta-hub/semantic-linking-microservice/app/test_coverage.py
+74
-0
test_coverage.py
...tion-hub/business-logic-microservice/app/test_coverage.py
+94
-0
No files found.
src/data-hub/semantic-linking-microservice/app/test_coverage.py
0 → 100644
View file @
757be2f9
import
unittest
import
sys
for
path
in
[
'../'
,
'./'
]:
sys
.
path
.
insert
(
1
,
path
)
class
TestCoverage
(
unittest
.
TestCase
):
def
test_init_main
(
self
):
# add modules folder to interpreter path
import
sys
import
os
import
prance
from
pathlib
import
Path
modules_path
=
'../../../modules/'
if
os
.
path
.
exists
(
modules_path
):
sys
.
path
.
insert
(
1
,
modules_path
)
# init logging to file
import
logging
LOG_FORMAT
=
(
'
%(levelname) -5
s
%(asctime)
s
%(name)
s:
%(funcName) -35
s
%(lineno) -5
d:
%(message)
s'
)
logging
.
basicConfig
(
level
=
logging
.
INFO
,
format
=
LOG_FORMAT
)
LOGGER
=
logging
.
getLogger
(
__name__
)
#################################
import
connexion
from
security
import
swagger_util
from
env_info
import
is_running_locally
,
get_resources_path
from
messaging.ReconnectingMessageManager
import
ReconnectingMessageManager
from
messaging.MessageHandler
import
MessageHandler
from
flask
import
request
from
flask
import
redirect
# init message handler
from
db.repository
import
Repository
import
main
def
test_routes
(
self
):
from
routes
import
debug
from
routes
import
layers
from
routes
import
nodes
def
test_messaging
(
self
):
import
network_constants
as
netconst
from
security.token_manager
import
TokenManager
from
db.entities
import
Layer
import
json
import
requests
from
typing
import
Dict
,
List
from
threading
import
Thread
import
logging
from
messaging
import
MessageHandler
def
test_db
(
self
):
import
network_constants
as
netconst
from
database.MongoRepositoryBase
import
MongoRepositoryBase
from
db.entities
import
Layer
import
pymongo
import
json
from
typing
import
List
,
Dict
# init logging to file
import
logging
from
db
import
repository
from
db.entities
import
layer
if
__name__
==
'__main__'
:
unittest
.
main
()
src/participation-hub/business-logic-microservice/app/test_coverage.py
0 → 100644
View file @
757be2f9
import
unittest
import
sys
for
path
in
[
'../'
,
'./'
]:
sys
.
path
.
insert
(
1
,
path
)
class
TestCoverage
(
unittest
.
TestCase
):
def
test_init_main
(
self
):
# python -m unittest discover
# add modules folder to interpreter path
import
sys
import
os
from
pathlib
import
Path
from
typing
import
Dict
,
Any
modules_path
=
'../../../modules/'
if
os
.
path
.
exists
(
modules_path
):
sys
.
path
.
insert
(
1
,
modules_path
)
# load swagger config
import
connexion
from
security
import
swagger_util
from
env_info
import
is_running_locally
,
get_resources_path
from
flask
import
request
from
flask
import
redirect
app
=
connexion
.
App
(
__name__
,
specification_dir
=
'configs/'
)
from
db.entities.layer_adapter
import
LayerAdapter
import
main
def
test_db_main
(
self
):
import
network_constants
as
netconst
from
database.MongoRepositoryBase
import
MongoRepositoryBase
from
db.entities
import
layer_adapter
from
db.entities
import
table
from
db.entities
import
use_case
import
pymongo
import
json
from
typing
import
List
,
Dict
from
db
import
repository
from
db
import
table_repository
from
db
import
use_case_repository
def
test_routes
(
self
):
from
routes
import
layer
from
routes
import
tables
from
routes
import
use_case
def
test_services
(
self
):
from
services
import
layer_adapter_service
def
test_use_case_scripts
(
self
):
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
import
requests
from
typing
import
List
from
_add_use_case_scripts
import
requestPost
#######
#from _add_use_case_scripts.bank-app import add_bank_app_schema ##eror not importing? invalid folder name?
#from _add_use_case_scripts.bank-app.tables import add_bank_app_schema
from
_add_use_case_scripts.car_sharing
import
add_carsharing_schema
from
_add_use_case_scripts.car_sharing.tables
import
add_car
from
_add_use_case_scripts.car_sharing.tables
import
add_hash
from
_add_use_case_scripts.car_sharing.tables
import
add_offer
from
_add_use_case_scripts.car_sharing.tables
import
add_publication
from
_add_use_case_scripts.car_sharing.tables
import
add_travel
from
_add_use_case_scripts.car_sharing.tables
import
add_user
from
_add_use_case_scripts.crowd_journalism
import
add_crowdjournalism_schema
from
_add_use_case_scripts.crowd_journalism.tables
import
add_classification
from
_add_use_case_scripts.crowd_journalism.tables
import
add_event
from
_add_use_case_scripts.crowd_journalism.tables
import
add_purchase
from
_add_use_case_scripts.crowd_journalism.tables
import
add_tag
from
_add_use_case_scripts.crowd_journalism.tables
import
add_video
from
_add_use_case_scripts.debug
import
add_debug_schema
from
_add_use_case_scripts.debug.tables
import
add_pizza_table
#from _add_use_case_scripts.smart-energy import add_smart_energy_schema
#from _add_use_case_scripts.smart-energy.tables import add_smart_energy
from
_add_use_case_scripts.vialog
import
add_vialog_schema
from
_add_use_case_scripts.vialog.tables
import
add_user
from
_add_use_case_scripts.vialog.tables
import
add_video
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment