Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
caosdb
Software
CaosDB Crawler
Commits
8d3334ac
Verified
Commit
8d3334ac
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
WIP TEST: TDD tests for
#87
: Handle long strings more gracefully
parent
ffc93747
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!160
STY: styling
,
!155
Mitigation of server problem with long strings as POV values
Checking pipeline status
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
integrationtests/test_issues.py
+31
-3
31 additions, 3 deletions
integrationtests/test_issues.py
with
31 additions
and
3 deletions
integrationtests/test_issues.py
+
31
−
3
View file @
8d3334ac
...
@@ -18,22 +18,24 @@
...
@@ -18,22 +18,24 @@
#
#
from
pytest
import
fixture
,
mark
from
pytest
import
fixture
,
mark
import
caosdb
as
db
import
linkahead
as
db
from
caosdb
.cached
import
cache_clear
from
linkahead
.cached
import
cache_clear
from
caosadvancedtools.models.parser
import
parse_model_from_string
from
caosadvancedtools.models.parser
import
parse_model_from_string
from
caoscrawler.crawl
import
Crawler
from
caoscrawler.crawl
import
Crawler
from
caoscrawler.identifiable
import
Identifiable
from
caoscrawler.identifiable_adapters
import
CaosDBIdentifiableAdapter
from
caoscrawler.identifiable_adapters
import
CaosDBIdentifiableAdapter
from
caoscrawler.structure_elements
import
DictElement
from
caoscrawler.structure_elements
import
DictElement
from
caoscrawler.scanner
import
create_converter_registry
,
scan_structure_elements
from
caoscrawler.scanner
import
create_converter_registry
,
scan_structure_elements
from
caosdb
.utils.register_tests
import
clear_database
,
set_test_key
from
linkahead
.utils.register_tests
import
clear_database
,
set_test_key
set_test_key
(
"
10b128cf8a1372f30aa3697466bb55e76974e0c16a599bb44ace88f19c8f61e2
"
)
set_test_key
(
"
10b128cf8a1372f30aa3697466bb55e76974e0c16a599bb44ace88f19c8f61e2
"
)
@fixture
(
autouse
=
True
)
@fixture
(
autouse
=
True
)
def
clear_cache
():
def
clear_cache
():
"""
Clear the LinkAhead cache.
"""
cache_clear
()
cache_clear
()
...
@@ -266,3 +268,29 @@ Campaign:
...
@@ -266,3 +268,29 @@ Campaign:
# Nothing to do for the existing ents
# Nothing to do for the existing ents
assert
len
(
ups
)
==
0
assert
len
(
ups
)
==
0
assert
ins
[
0
].
name
==
event
.
name
assert
ins
[
0
].
name
==
event
.
name
def
test_indiscale_87
(
clear_database
):
"""
Handle long string queries gracefully.
https://gitlab.com/linkahead/linkahead-crawler/-/issues/87
"""
prop
=
db
.
Property
(
name
=
"
str
"
,
datatype
=
db
.
TEXT
).
insert
()
rt
=
db
.
RecordType
(
name
=
"
RT1
"
).
add_property
(
prop
).
insert
()
strings
=
[
"
0123456789
"
*
26
,
"
0
"
*
260
,
"
0123456789
"
*
25
+
"
9876543210
"
,
]
recs
=
[
db
.
Record
().
add_parent
(
rt
).
add_property
(
name
=
"
str
"
,
value
=
string
).
insert
()
for
string
in
strings
]
idents
=
[
Identifiable
(
record_type
=
"
RT1
"
,
properties
=
{
"
str
"
:
string
})
for
string
in
strings
]
adapter
=
CaosDBIdentifiableAdapter
()
for
rec
,
ident
in
zip
(
recs
,
idents
):
assert
adapter
.
retrieve_identified_record_for_identifiable
(
ident
)
==
rec
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