Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
4993acd1
Commit
4993acd1
authored
Oct 15, 2020
by
Jibril Mammeri
Browse files
Improve message when hard limit is reached
parent
996e88ef
Pipeline
#35415
failed with stages
in 85 minutes and 4 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bliss/common/axis.py
View file @
4993acd1
...
...
@@ -1911,7 +1911,9 @@ class Axis:
self
.
_update_settings
(
state
)
if
not
state
.
MOVING
:
if
limit_error
and
(
state
.
LIMPOS
or
state
.
LIMNEG
):
raise
AxisOnLimitError
(
str
(
state
))
raise
AxisOnLimitError
(
f
"
{
self
.
name
}
:
{
str
(
state
)
}
at
{
self
.
position
}
"
)
elif
state
.
FAULT
:
raise
AxisFaultError
(
str
(
state
))
return
state
...
...
tests/motors/test_axis_messages.py
View file @
4993acd1
...
...
@@ -6,6 +6,8 @@
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import
pytest
from
unittest
import
mock
from
bliss.common.axis
import
AxisState
,
AxisOnLimitError
def
test_axis_stdout
(
roby
,
capsys
,
log_shell_mode
):
...
...
@@ -47,3 +49,16 @@ def test_axis_stdout2(roby, bad_motor, capsys, log_shell_mode):
out
,
err
=
capsys
.
readouterr
()
assert
"Axis roby stopped at position"
in
out
def
test_axis_stderr1
(
roby
):
with
mock
.
patch
.
object
(
roby
.
controller
,
"state"
)
as
new_state
:
new_state
.
return_value
=
AxisState
(
"READY"
,
"LIMNEG"
)
assert
roby
.
state
.
LIMNEG
with
pytest
.
raises
(
AxisOnLimitError
,
match
=
r
"roby: READY \(Axis is READY\) \| "
r
"LIMNEG \(Hardware low limit active\) at [0-9\.]*"
,
):
roby
.
jog
()
roby
.
stop
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment