Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
e3-require
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
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
ESS EPICS Environment
wrappers
e3-require
Commits
0ca32f0f
Commit
0ca32f0f
authored
1 year ago
by
Lucas Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for generated PVs
parent
c9944227
No related branches found
No related tags found
1 merge request
!139
E3-1214: Fix usage of string functions
Pipeline
#153296
passed
1 year ago
Stage: check
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_iocsh.py
+39
-1
39 additions, 1 deletion
tests/test_iocsh.py
with
39 additions
and
1 deletion
tests/test_iocsh.py
+
39
−
1
View file @
0ca32f0f
import
re
import
re
import
pytest
import
os
from
.utils
import
Wrapper
,
run_ioc_get_output
from
.utils
import
Wrapper
,
run_ioc_get_output
...
@@ -53,3 +54,40 @@ def test_after_init():
...
@@ -53,3 +54,40 @@ def test_after_init():
lines
=
outs
.
split
(
"
\n
"
)
lines
=
outs
.
split
(
"
\n
"
)
assert
"
hello
"
in
lines
[
lines
.
index
(
"
iocInit
"
)
:]
assert
"
hello
"
in
lines
[
lines
.
index
(
"
iocInit
"
)
:]
@pytest.mark.parametrize
(
"
pv, expected
"
,
[
(
"
Modules
"
,
r
"
\"require\" *\"{name}\"
"
),
(
"
Versions
"
,
r
"
\"[0-9a-z.+-]+\" *\"{version}\"
"
),
(
"
ModuleVersions
"
,
r
"
require [0-9a-z.+-]+\\n{name} {version}\\n
"
),
(
"
{name}Version
"
,
r
"
{version}
"
),
(
"
requireVersion
"
,
r
"
[0-9a-z.+-]+
"
),
],
)
def
test_require_pvs
(
wrapper
:
Wrapper
,
pv
,
expected
):
cell_path
=
wrapper
.
path
/
"
cellMods
"
returncode
,
_
,
_
=
wrapper
.
run_make
(
"
cellinstall
"
,
cell_path
=
cell_path
,
)
os
.
environ
[
"
IOCNAME
"
]
=
"
TEST
"
rc
,
stdout
,
_
=
run_ioc_get_output
(
"
-l
"
,
cell_path
,
"
-r
"
,
wrapper
.
name
,
"
-c
"
,
"
afterInit dbgf TEST:
"
+
pv
.
format
(
name
=
wrapper
.
name
),
)
assert
rc
==
0
match
=
re
.
search
(
expected
.
format
(
name
=
wrapper
.
name
,
version
=
wrapper
.
version
.
replace
(
"
.
"
,
"
\\
.
"
).
replace
(
"
+
"
,
"
\\
+
"
),
),
stdout
,
)
assert
match
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