-
Notifications
You must be signed in to change notification settings - Fork 6
force_sequence example added #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
amccann-Tek
wants to merge
8
commits into
tektronix:main
Choose a base branch
from
amccann-Tek:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
=======================================
Coverage 80.72% 80.72%
=======================================
Files 3 3
Lines 524 524
Branches 94 94
=======================================
Hits 423 423
Misses 82 82
Partials 19 19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
nfelt14
requested changes
Apr 17, 2025
Co-authored-by: Nicholas Felt <[email protected]> Signed-off-by: Andrew McCann <[email protected]>
Co-authored-by: Nicholas Felt <[email protected]> Signed-off-by: Andrew McCann <[email protected]>
Co-authored-by: Nicholas Felt <[email protected]> Signed-off-by: Andrew McCann <[email protected]>
Co-authored-by: Nicholas Felt <[email protected]> Signed-off-by: Andrew McCann <[email protected]>
Co-authored-by: Nicholas Felt <[email protected]> Signed-off-by: Andrew McCann <[email protected]>
nfelt14
requested changes
Apr 18, 2025
Signed-off-by: Nicholas Felt <[email protected]>
nfelt14
approved these changes
Apr 18, 2025
Test Results (ubuntu)
tests/test_client.pytekhsi_client = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
capsys = <_pytest.capture.CaptureFixture object at 0x7f7818f6b470>
instrument = True, sum_count = 5, sum_acq_time = 10.0, sum_data_rate = 50.0
expected_output = 'Average Update Rate:0.50, Data Rate:10.00Mbs'
@pytest.mark.parametrize(
("instrument", "sum_count", "sum_acq_time", "sum_data_rate", "expected_output"),
[
(True, 5, 10.0, 50.0, "Average Update Rate:0.50, Data Rate:10.00Mbs"),
],
)
def test_server_connection(
tekhsi_client: TekHSIConnect,
capsys: pytest.CaptureFixture[str],
instrument: bool,
sum_count: int,
sum_acq_time: float,
sum_data_rate: float,
expected_output: str,
) -> None:
"""Test the server connection using the TekHSI client.
Args:
tekhsi_client: An instance of the TekHSI client to be tested.
capsys (CaptureFixture): Pytest fixture to capture system output.
instrument: Whether the instrument is connected.
sum_count: The sum count.
sum_acq_time: The sum acquisition time.
sum_data_rate: The sum data rate.
expected_output: The expected output message.
"""
# Set the required attributes
tekhsi_client._instrument = instrument
tekhsi_client._sum_count = sum_count
tekhsi_client._sum_acq_time = sum_acq_time
tekhsi_client._sum_data_rate = sum_data_rate
# Set the verbose attribute to True
tekhsi_client.verbose = True
# Use the context manager to handle connection
> with tekhsi_client as connection:
capsys = <_pytest.capture.CaptureFixture object at 0x7f7818f6b470>
captured = CaptureResult(out='2025-04-18 16:20:46.000492 - enter()\n', err='')
connection = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
expected_output = 'Average Update Rate:0.50, Data Rate:10.00Mbs'
instrument = True
request = name: "test_client"
response = status: CONNECTSTATUS_SUCCESS
sum_acq_time = 10.0
sum_count = 5
sum_data_rate = 50.0
tekhsi_client = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
tests/test_client.py:58:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/tests/lib/python3.12/site-packages/tekhsi/tek_hsi_connect.py:211: in __exit__
self.close()
exc_tb = None
exc_type = None
exc_val = None
self = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
.tox/tests/lib/python3.12/site-packages/tekhsi/tek_hsi_connect.py:443: in close
self.force_sequence()
self = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
.tox/tests/lib/python3.12/site-packages/tekhsi/tek_hsi_connect.py:513: in force_sequence
self.connection.RequestNewSequence(request)
request = name: "8c789843-6bd9-424e-903f-302e0c98d352"
self = <tekhsi.tek_hsi_connect.TekHSIConnect object at 0x7f7819088140>
.tox/tests/lib/python3.12/site-packages/grpc/_channel.py:1181: in __call__
return _end_unary_response_blocking(state, call, False, None)
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7f7818e157c0>
compression = None
credentials = None
metadata = None
request = name: "8c789843-6bd9-424e-903f-302e0c98d352"
self = <grpc._channel._UnaryUnaryMultiCallable object at 0x7f7818ec5b00>
state = <grpc._channel._RPCState object at 0x7f7818f6bb00>
timeout = None
wait_for_ready = None
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
state = <grpc._channel._RPCState object at 0x7f7818f6bb00>
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7f7818e157c0>
with_call = False, deadline = None
def _end_unary_response_blocking(
state: _RPCState,
call: cygrpc.SegregatedCall,
with_call: bool,
deadline: Optional[float],
) -> Union[ResponseType, Tuple[ResponseType, grpc.Call]]:
if state.code is grpc.StatusCode.OK:
if with_call:
rendezvous = _MultiThreadedRendezvous(state, call, None, deadline)
return state.response, rendezvous
else:
return state.response
else:
> raise _InactiveRpcError(state) # pytype: disable=not-instantiable
E grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
E status = StatusCode.FAILED_PRECONDITION
E details = ""
E debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B::1%5D:50312 {grpc_message:"", grpc_status:9, created_time:"2025-04-18T16:20:46.497537315+00:00"}"
E >
call = <grpc._cython.cygrpc.SegregatedCall object at 0x7f7818e157c0>
deadline = None
state = <grpc._channel._RPCState object at 0x7f7818f6bb00>
with_call = False
.tox/tests/lib/python3.12/site-packages/grpc/_channel.py:1006: _InactiveRpcError |
Test Results (macos)
|
Test Results (windows)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Updated documentation and examples for force_sequence(). No direct src changes.
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Addresses #<issue_number>