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
d68adb73
Commit
d68adb73
authored
2 years ago
by
Carlos Natalino Da Silva
Browse files
Options
Downloads
Patches
Plain Diff
Fixing tests of the dbscanserving.
parent
5949b54d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/dbscanserving/client/DbscanServingClient.py
+1
-2
1 addition, 2 deletions
src/dbscanserving/client/DbscanServingClient.py
src/dbscanserving/tests/test_unitary.py
+12
-3
12 additions, 3 deletions
src/dbscanserving/tests/test_unitary.py
with
13 additions
and
5 deletions
src/dbscanserving/client/DbscanServingClient.py
+
1
−
2
View file @
d68adb73
...
@@ -66,8 +66,7 @@ class DbscanServingClient:
...
@@ -66,8 +66,7 @@ class DbscanServingClient:
response
:
DetectionResponse
=
self
.
stub
.
Detect
(
request
)
response
:
DetectionResponse
=
self
.
stub
.
Detect
(
request
)
LOGGER
.
debug
(
LOGGER
.
debug
(
"
Detect result with {} cluster indices [{}]
"
.
format
(
"
Detect result with {} cluster indices [{}]
"
.
format
(
len
(
response
.
cluster_indices
),
len
(
response
.
cluster_indices
),
Counter
(
response
.
cluster_indices
)
Counter
(
response
.
cluster_indices
)
)
)
)
)
return
response
return
response
This diff is collapsed.
Click to expand it.
src/dbscanserving/tests/test_unitary.py
+
12
−
3
View file @
d68adb73
...
@@ -13,9 +13,10 @@
...
@@ -13,9 +13,10 @@
# limitations under the License.
# limitations under the License.
import
logging
import
logging
import
os
import
random
import
random
from
unittest.mock
import
patch
import
numpy
import
pytest
import
pytest
from
common.proto.dbscanserving_pb2
import
DetectionRequest
,
DetectionResponse
,
Sample
from
common.proto.dbscanserving_pb2
import
DetectionRequest
,
DetectionResponse
,
Sample
from
dbscanserving.client.DbscanServingClient
import
DbscanServingClient
from
dbscanserving.client.DbscanServingClient
import
DbscanServingClient
...
@@ -40,8 +41,16 @@ def dbscanserving_service():
...
@@ -40,8 +41,16 @@ def dbscanserving_service():
@pytest.fixture
(
scope
=
"
session
"
)
@pytest.fixture
(
scope
=
"
session
"
)
def
dbscanserving_client
():
def
dbscanserving_client
():
_client
=
DbscanServingClient
(
host
=
"
127.0.0.1
"
,
port
=
port
)
with
patch
.
dict
(
yield
_client
os
.
environ
,
{
"
DBSCANSERVINGSERVICE_SERVICE_HOST
"
:
"
127.0.0.1
"
,
"
DBSCANSERVINGSERVICE_SERVICE_PORT_GRPC
"
:
str
(
port
),
},
clear
=
True
,
):
_client
=
DbscanServingClient
()
yield
_client
_client
.
close
()
_client
.
close
()
...
...
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