Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
TFS
controller
Commits
a045f9fe
Commit
a045f9fe
authored
1 year ago
by
Carlos Natalino Da Silva
Browse files
Options
Downloads
Patches
Plain Diff
Improving tests.
parent
dc22fc8f
No related branches found
No related tags found
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!138
Fixing the tests of the optical cybersecurity components
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/opticalattackdetector/tests/test_unitary.py
+0
-1
0 additions, 1 deletion
src/opticalattackdetector/tests/test_unitary.py
src/opticalattackmanager/tests/test_unitary.py
+18
-17
18 additions, 17 deletions
src/opticalattackmanager/tests/test_unitary.py
with
18 additions
and
18 deletions
src/opticalattackdetector/tests/test_unitary.py
+
0
−
1
View file @
a045f9fe
...
...
@@ -31,7 +31,6 @@ from opticalattackdetector.service.OpticalAttackDetectorService import \
# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
setLevel
(
logging
.
DEBUG
)
@pytest.fixture
(
scope
=
"
session
"
)
...
...
This diff is collapsed.
Click to expand it.
src/opticalattackmanager/tests/test_unitary.py
+
18
−
17
View file @
a045f9fe
...
...
@@ -13,26 +13,27 @@
# limitations under the License.
import
logging
import
os
from
unittest.mock
import
patch
import
uuid
import
pytest
from
opticalattackmanager.utils.monitor
import
delegate_services
from
common.Constants
import
(
DEFAULT_GRPC_GRACE_PERIOD
,
DEFAULT_GRPC_MAX_WORKERS
,
DEFAULT_SERVICE_GRPC_PORTS
,
ServiceNameEnum
)
from
common.proto
import
dbscanserving_pb2
as
dbscan
from
common.proto.optical_attack_detector_pb2
import
DetectionRequest
from
opticalattackdetector.client.OpticalAttackDetectorClient
import
\
OpticalAttackDetectorClient
from
opticalattackdetector.service.OpticalAttackDetectorService
import
\
OpticalAttackDetectorService
# from .example_objects import CONTEXT_ID, CONTEXT_ID_2, SERVICE_DEV1_DEV2
LOGGER
=
logging
.
getLogger
(
__name__
)
LOGGER
.
setLevel
(
logging
.
DEBUG
)
def
test_detect_attack
():
LOGGER
.
info
(
"
placeholder
"
)
def
test_delegate_services
():
service_list
=
[
{
"
context
"
:
uuid
.
uuid4
(),
"
service
"
:
uuid
.
uuid4
(),
"
kpi
"
:
10
,
}
for
_
in
range
(
10
)]
delegate_services
(
service_list
=
service_list
,
start_index
=
0
,
end_index
=
9
,
host
=
"
127.0.0.1
"
,
port
=
"
10006
"
,
monitoring_interval
=
10
,
)
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