Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-webui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
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-webui
Commits
543dc35c
Verified
Commit
543dc35c
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
TST: Add test data for ext_cosmetics
parent
b72a7b04
No related branches found
No related tags found
2 merge requests
!47
Release v0.4.0
,
!42
F test linkify
Pipeline
#13559
passed
3 years ago
Stage: linting
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build.properties.d/00_default.properties
+1
-0
1 addition, 0 deletions
build.properties.d/00_default.properties
misc/ext_cosmetics_test_data.py
+67
-0
67 additions, 0 deletions
misc/ext_cosmetics_test_data.py
with
68 additions
and
0 deletions
build.properties.d/00_default.properties
+
1
−
0
View file @
543dc35c
...
...
@@ -148,4 +148,5 @@ MODULE_DEPENDENCIES=(
ext_sss_markdown.js
ext_trigger_crawler_form.js
ext_bookmarks.js
ext_cosmetics.js
)
This diff is collapsed.
Click to expand it.
misc/ext_cosmetics_test_data.py
0 → 100755
+
67
−
0
View file @
543dc35c
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ** header v3.0
# This file is a part of the CaosDB Project.
#
# Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
# Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
# ** end header
import
caosdb
as
db
# clean
old
=
db
.
execute_query
(
"
FIND Test*
"
)
if
len
(
old
):
old
.
delete
()
# data model
datamodel
=
db
.
Container
()
datamodel
.
extend
([
db
.
Property
(
"
TestProp
"
,
datatype
=
db
.
TEXT
),
db
.
RecordType
(
"
TestRecordType
"
),
])
datamodel
.
insert
()
# test data
testdata
=
db
.
Container
()
test_cases
=
[
"
no link
"
,
"
https://example.com
"
,
"
https://example.com and http://example.com
"
,
"
this is text https://example.com
"
,
"
this is text https://example.com and this as well
"
,
"
this is text https://example.com and another linke https://example.com
"
,
"
this is text https://example.com and another linke https://example.com and more text
"
,
(
"
this is a lot of text with links in it Lorem ipsum dolor sit amet,
"
"
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore
"
"
et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
"
"
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
"
"
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
"
"
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
"
"
proident, sunt in culpa qui officia deserunt mollit anim id est
"
"
laborum.https://example.com and another linke https://example.com and
"
"
more text and here comes a very long link:
"
"
https://example.com/this/has/certainly/more/than/40/characters/just/count/if/you/dont/believe/it.html
"
),
]
for
test_case
in
test_cases
:
testdata
.
append
(
db
.
Record
().
add_parent
(
"
TestRecordType
"
).
add_property
(
"
TestProp
"
,
test_case
))
testdata
.
insert
()
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