Skip to content

Unit-test test:device acroname control (for py only) - #8359

Merged
maloel merged 13 commits into
realsenseai:developmentfrom
maloel:rut
Feb 15, 2021
Merged

Unit-test test:device acroname control (for py only)#8359
maloel merged 13 commits into
realsenseai:developmentfrom
maloel:rut

Conversation

@maloel

@maloel maloel commented Feb 14, 2021

Copy link
Copy Markdown
Contributor

Separated log functionality into rspy.log module
Use devices module from run-unit-tests.py
Changed python subprocess invocation to sys.executable
HWM cmd SET_AGE -> UNIT_AGE_SET, to fit XML

@maloel
maloel requested review from MMirbach and Nir-Az February 14, 2021 14:02
if timeout <= 0:
return False
timeout -= 1
time.sleep( 1 )

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember you can use "timer" class utility if you want :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went to do that, but saw that in this case it wouldn't necessarily reduce code much, so left as-is.

while True:
have_devices = False
for sn in serial_numbers:
if sn in _device_by_sn:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for " global _device_by_sn"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

#
have_all_devices = True
for sn in serial_numbers:
if sn not in _device_by_sn:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

global needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@@ -1,5 +1,12 @@
from rspy import acroname
try:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

License?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Comment thread unit-tests/py/rspy/log.py Outdated
@@ -0,0 +1,90 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2020 Intel Corporation. All Rights Reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed :)

@Nir-Az Nir-Az left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@maloel
maloel merged commit 0898024 into realsenseai:development Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants