Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
elasticsearch
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
Service Desk
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
cubicweb
cubes
elasticsearch
Commits
afd8a876c64c
Commit
afd8a876c64c
authored
8 years ago
by
Samuel Trégouët
Browse files
Options
Downloads
Patches
Plain Diff
test: fulltext_indexable_rql
parent
6527f18a1a69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/data/schema.py
+8
-0
8 additions, 0 deletions
test/data/schema.py
test/test_elastic_search.py
+15
-2
15 additions, 2 deletions
test/test_elastic_search.py
with
23 additions
and
2 deletions
test/data/schema.py
0 → 100644
+
8
−
0
View file @
afd8a876
from
yams.buildobjs
import
(
EntityType
,
String
,
Int
,
SubjectRelation
,
RelationDefinition
)
class
Person
(
EntityType
):
name
=
String
()
age
=
Int
()
This diff is collapsed.
Click to expand it.
test/test_elastic_search.py
+
15
−
2
View file @
afd8a876
...
...
@@ -13,7 +13,8 @@
from
cubicweb.devtools
import
testlib
from
cubicweb.cwconfig
import
CubicWebConfiguration
from
cubes.elasticsearch
import
ccplugin
from
cubes.elasticsearch.es
import
indexable_types
,
INDEX_SETTINGS
from
cubes.elasticsearch.es
import
(
indexable_types
,
INDEX_SETTINGS
,
fulltext_indexable_rql
)
# TODO - find a way to configure ElasticSearch as non threaded while running tests
# so that the traces show the full stack, not just starting from connection.http_*
...
...
@@ -157,7 +158,7 @@
with
self
.
new_access
(
'
anon
'
).
web_request
()
as
req
:
# self._cw.form.get('search'))
self
.
view
(
'
esearch
'
,
req
=
req
,
template
=
None
)
@patch
(
'
elasticsearch_dsl.search.Search.execute
'
,
new
=
mock_execute_150
)
@patch
(
'
elasticsearch_dsl.connections.connections.get_connection
'
,
new
=
mock_cnx
)
def
skip_test_search_view_150
(
self
):
...
...
@@ -166,5 +167,17 @@
self
.
view
(
'
esearch
'
,
req
=
req
,
template
=
None
)
class
ElasticsearchTC
(
testlib
.
CubicWebTC
):
def
test_1
(
self
):
with
self
.
admin_access
.
cnx
()
as
cnx
:
print
(
cnx
.
vreg
.
schema
)
schema
=
cnx
.
vreg
.
schema
etype
=
'
Person
'
rql
=
fulltext_indexable_rql
(
etype
,
schema
)
self
.
assertIn
(
'
age
'
,
rql
)
self
.
assertNotIn
(
'
eid
'
,
rql
)
if
__name__
==
'
__main__
'
:
unittest
.
main
()
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