qc.harp¶
HarpDeviceTestSuite ¶
HarpDeviceTestSuite(
harp_device: HarpDevice,
harp_device_commands: Optional[HarpDevice] = None,
*,
min_core_version: Optional[str] = None,
)
Bases: Suite
Test suite for generic HARP devices.
Provides a set of standard tests that all HARP devices are expected to pass, checking basic functionality and data integrity.
Attributes:
Name | Type | Description |
---|---|---|
harp_device |
The HarpDevice data stream to test. |
|
harp_device_commands |
Optional HarpDevice data stream with device commands. |
|
min_core_version |
Optional minimum required core version. |
Examples:
from contraqctor.contract.harp import HarpDevice
from contraqctor.qc.harp import HarpDeviceTestSuite
from contraqctor.qc.base import Runner
# Create HarpDevice streams
device = HarpDevice("behavior", reader_params=params).load()
commands = HarpDevice("behavior_commands", reader_params=command_params).load()
# Create and run test suite
suite = HarpDeviceTestSuite(device, commands, min_core_version="1.2.0")
runner = Runner().add_suite(suite)
results = runner.run_all_with_progress()
Initialize the HARP device test suite.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
harp_device
|
HarpDevice
|
The HarpDevice data stream to test. |
required |
harp_device_commands
|
Optional[HarpDevice]
|
Optional HarpDevice data stream with command history. If None, tests requiring the commands will be skipped. |
None
|
min_core_version
|
Optional[str]
|
Optional minimum required core version for validation. |
None
|
Source code in src/contraqctor/qc/harp.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
description
property
¶
name
property
¶
name: str
Get the name of the test suite.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the test suite class. |
test_has_whoami ¶
test_has_whoami()
Check if the harp board data stream is present and return its value
Source code in src/contraqctor/qc/harp.py
98 99 100 101 102 103 104 105 106 107 108 |
|
test_match_whoami_to_yml ¶
test_match_whoami_to_yml()
Check if the WhoAmI value matches the device's WhoAmI
Source code in src/contraqctor/qc/harp.py
110 111 112 113 114 115 |
|
test_read_dump_is_complete ¶
test_read_dump_is_complete()
Check if the read dump from an harp device is complete
Source code in src/contraqctor/qc/harp.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
test_request_response ¶
test_request_response()
Check that each request to the device has a corresponding response
Source code in src/contraqctor/qc/harp.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
test_registers_are_monotonicity ¶
test_registers_are_monotonicity()
Check that the all the harp device registers' timestamps are monotonic
Source code in src/contraqctor/qc/harp.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
|
test_fw_version_matches_reader ¶
test_fw_version_matches_reader()
Check if the firmware version of the device matches the one in the reader
Source code in src/contraqctor/qc/harp.py
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
test_core_version ¶
test_core_version()
Check if the core version of the device matches the one provided
Source code in src/contraqctor/qc/harp.py
248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
get_tests ¶
Find all methods starting with 'test'.
Yields:
Name | Type | Description |
---|---|---|
ITest |
ITest
|
Test methods found in the suite. |
Source code in src/contraqctor/qc/base.py
321 322 323 324 325 326 327 328 329 |
|
pass_test ¶
pass_test() -> Result
pass_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a passing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test passed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with PASSED status. |
Source code in src/contraqctor/qc/base.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
warn_test ¶
warn_test() -> Result
warn_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a warning test result.
Creates a result with WARNING status, or FAILED if warnings are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing the warning. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with WARNING or FAILED status. |
Source code in src/contraqctor/qc/base.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
|
fail_test ¶
fail_test() -> Result
fail_test(
result: Optional[Any] = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a failing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Optional[Any]
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test failed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with FAILED status. |
Source code in src/contraqctor/qc/base.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
|
skip_test ¶
skip_test() -> Result
Create a skipped test result.
Creates a result with SKIPPED status, or FAILED if skips are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Optional[str]
|
Optional message explaining why the test was skipped. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with SKIPPED or FAILED status. |
Source code in src/contraqctor/qc/base.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
setup ¶
setup() -> None
Run before each test method.
This method can be overridden by subclasses to implement setup logic that runs before each test.
Source code in src/contraqctor/qc/base.py
685 686 687 688 689 690 691 |
|
teardown ¶
teardown() -> None
Run after each test method.
This method can be overridden by subclasses to implement teardown logic that runs after each test.
Source code in src/contraqctor/qc/base.py
693 694 695 696 697 698 699 |
|
run_test ¶
Run a single test method and yield its results.
Handles setup, test execution, result processing, and teardown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_method
|
ITest
|
The test method to run. |
required |
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by the test method. |
Source code in src/contraqctor/qc/base.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
|
run_all ¶
Run all test methods in the suite.
Finds all test methods and runs them in sequence.
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by all test methods. |
Source code in src/contraqctor/qc/base.py
785 786 787 788 789 790 791 792 793 794 |
|
HarpHubTestSuite ¶
HarpHubTestSuite(
clock_generator_device: HarpDevice,
devices: List[HarpDevice],
*,
read_dump_jitter_threshold_s: Optional[float] = 0.05,
)
Bases: Suite
Test suite for a hub of HARP devices.
Tests a collection of HARP devices that share the same clock generator source, verifying proper synchronization and configuration.
Attributes:
Name | Type | Description |
---|---|---|
clock_generator_device |
The HARP device acting as the clock generator. |
|
devices |
List of subordinate HARP devices to test. |
|
read_dump_jitter_threshold_s |
Maximum allowed time difference for read dumps. |
Examples:
from contraqctor.contract.harp import HarpDevice
from contraqctor.qc.harp import HarpHubTestSuite
from contraqctor.qc.base import Runner
# Create HarpDevice streams
clock_gen = HarpDevice("clock_gen", reader_params=clock_params).load()
device1 = HarpDevice("device1", reader_params=params1).load()
device2 = HarpDevice("device2", reader_params=params2).load()
# Create and run hub test suite
suite = HarpHubTestSuite(clock_gen, [device1, device2])
runner = Runner().add_suite(suite)
results = runner.run_all_with_progress()
Initialize the HARP hub test suite.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clock_generator_device
|
HarpDevice
|
The HARP device acting as the clock generator. |
required |
devices
|
List[HarpDevice]
|
List of HARP devices to test as part of the hub. |
required |
read_dump_jitter_threshold_s
|
Optional[float]
|
Maximum allowed time difference (in seconds) between devices' read dumps. Defaults to 0.05. |
0.05
|
Source code in src/contraqctor/qc/harp.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
description
property
¶
name
property
¶
name: str
Get the name of the test suite.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the test suite class. |
test_clock_generator_reg ¶
test_clock_generator_reg()
Checks if the clock generator device is actually a clock generator
Source code in src/contraqctor/qc/harp.py
319 320 321 322 323 324 325 326 327 |
|
test_devices_are_subordinate ¶
test_devices_are_subordinate()
Checks if the devices are subordinate to the clock generator
Source code in src/contraqctor/qc/harp.py
329 330 331 332 333 334 335 336 337 |
|
test_is_read_dump_synchronized ¶
test_is_read_dump_synchronized()
Check if the read dump from the devices arrives are roughly the same time
Source code in src/contraqctor/qc/harp.py
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
|
get_tests ¶
Find all methods starting with 'test'.
Yields:
Name | Type | Description |
---|---|---|
ITest |
ITest
|
Test methods found in the suite. |
Source code in src/contraqctor/qc/base.py
321 322 323 324 325 326 327 328 329 |
|
pass_test ¶
pass_test() -> Result
pass_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a passing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test passed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with PASSED status. |
Source code in src/contraqctor/qc/base.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
warn_test ¶
warn_test() -> Result
warn_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a warning test result.
Creates a result with WARNING status, or FAILED if warnings are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing the warning. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with WARNING or FAILED status. |
Source code in src/contraqctor/qc/base.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
|
fail_test ¶
fail_test() -> Result
fail_test(
result: Optional[Any] = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a failing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Optional[Any]
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test failed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with FAILED status. |
Source code in src/contraqctor/qc/base.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
|
skip_test ¶
skip_test() -> Result
Create a skipped test result.
Creates a result with SKIPPED status, or FAILED if skips are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Optional[str]
|
Optional message explaining why the test was skipped. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with SKIPPED or FAILED status. |
Source code in src/contraqctor/qc/base.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
setup ¶
setup() -> None
Run before each test method.
This method can be overridden by subclasses to implement setup logic that runs before each test.
Source code in src/contraqctor/qc/base.py
685 686 687 688 689 690 691 |
|
teardown ¶
teardown() -> None
Run after each test method.
This method can be overridden by subclasses to implement teardown logic that runs after each test.
Source code in src/contraqctor/qc/base.py
693 694 695 696 697 698 699 |
|
run_test ¶
Run a single test method and yield its results.
Handles setup, test execution, result processing, and teardown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_method
|
ITest
|
The test method to run. |
required |
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by the test method. |
Source code in src/contraqctor/qc/base.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
|
run_all ¶
Run all test methods in the suite.
Finds all test methods and runs them in sequence.
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by all test methods. |
Source code in src/contraqctor/qc/base.py
785 786 787 788 789 790 791 792 793 794 |
|
HarpDeviceTypeTestSuite ¶
HarpDeviceTypeTestSuite(harp_device: HarpDevice)
Base test suite for specific types of HARP devices.
Abstract base class providing common functionality for testing specific HARP device types with known WhoAmI identifiers.
Attributes:
Name | Type | Description |
---|---|---|
harp_device |
The HARP device to test. |
|
_WHOAMI |
int
|
Class variable defining the expected WhoAmI value for this device type. |
Initialize the device type test suite.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
harp_device
|
HarpDevice
|
The HARP device to test. |
required |
Source code in src/contraqctor/qc/harp.py
389 390 391 392 393 394 395 |
|
whoami
property
¶
whoami: int
Get the expected WhoAmI value for this device type.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The expected WhoAmI identifier. |
description
property
¶
name
property
¶
name: str
Get the name of the test suite.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the test suite class. |
test_whoami ¶
test_whoami()
Check if the WhoAmI value is correct
Source code in src/contraqctor/qc/harp.py
406 407 408 409 410 411 412 413 414 |
|
get_tests ¶
Find all methods starting with 'test'.
Yields:
Name | Type | Description |
---|---|---|
ITest |
ITest
|
Test methods found in the suite. |
Source code in src/contraqctor/qc/base.py
321 322 323 324 325 326 327 328 329 |
|
pass_test ¶
pass_test() -> Result
pass_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a passing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test passed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with PASSED status. |
Source code in src/contraqctor/qc/base.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
warn_test ¶
warn_test() -> Result
warn_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a warning test result.
Creates a result with WARNING status, or FAILED if warnings are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing the warning. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with WARNING or FAILED status. |
Source code in src/contraqctor/qc/base.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
|
fail_test ¶
fail_test() -> Result
fail_test(
result: Optional[Any] = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a failing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Optional[Any]
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test failed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with FAILED status. |
Source code in src/contraqctor/qc/base.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
|
skip_test ¶
skip_test() -> Result
Create a skipped test result.
Creates a result with SKIPPED status, or FAILED if skips are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Optional[str]
|
Optional message explaining why the test was skipped. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with SKIPPED or FAILED status. |
Source code in src/contraqctor/qc/base.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
setup ¶
setup() -> None
Run before each test method.
This method can be overridden by subclasses to implement setup logic that runs before each test.
Source code in src/contraqctor/qc/base.py
685 686 687 688 689 690 691 |
|
teardown ¶
teardown() -> None
Run after each test method.
This method can be overridden by subclasses to implement teardown logic that runs after each test.
Source code in src/contraqctor/qc/base.py
693 694 695 696 697 698 699 |
|
run_test ¶
Run a single test method and yield its results.
Handles setup, test execution, result processing, and teardown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_method
|
ITest
|
The test method to run. |
required |
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by the test method. |
Source code in src/contraqctor/qc/base.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
|
run_all ¶
Run all test methods in the suite.
Finds all test methods and runs them in sequence.
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by all test methods. |
Source code in src/contraqctor/qc/base.py
785 786 787 788 789 790 791 792 793 794 |
|
HarpSniffDetectorTestSuite ¶
HarpSniffDetectorTestSuite(
harp_device: HarpDevice,
quantization_ratio_thr: float = 0.1,
clustering_thr: float = 0.05,
clipping_thr: float = 0.05,
sudden_jumps_thr: float = 0.001,
notch_filter_freq: float = 50,
)
Bases: HarpDeviceTypeTestSuite
Test suite for HARP Sniff Detector devices.
Provides tests specific to the Sniff Detector device, including signal quality analysis and breathing rate detection.
Attributes:
Name | Type | Description |
---|---|---|
harp_device |
The HARP Sniff Detector device to test. |
|
data |
DataFrame
|
The raw voltage data from the device. |
fs |
float
|
The sampling frequency of the device. |
quantization_ratio_thr |
Threshold for the quantization ratio test. |
|
clustering_thr |
Threshold for the clustering ratio test. |
|
clipping_thr |
Threshold for the clipping detection test. |
|
sudden_jumps_thr |
Threshold for the sudden jumps detection test. |
|
notch_filter_freq |
Frequency (Hz) for the notch filter. |
Examples:
from contraqctor.contract.harp import HarpDevice
from contraqctor.qc.harp import HarpSniffDetectorTestSuite
from contraqctor.qc.base import Runner
# Create and load the sniff detector device
device = HarpDevice("sniff", reader_params=params).load()
# Create the test suite with custom thresholds
suite = HarpSniffDetectorTestSuite(
device,
quantization_ratio_thr=0.1,
clustering_thr=0.05,
notch_filter_freq=60 # For 60Hz power
)
# Run tests
runner = Runner().add_suite(suite)
results = runner.run_all_with_progress()
Initialize the Sniff Detector test suite.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
harp_device
|
HarpDevice
|
The HARP Sniff Detector device to test. |
required |
quantization_ratio_thr
|
float
|
Threshold for the quantization ratio test. Defaults to 0.1. |
0.1
|
clustering_thr
|
float
|
Threshold for the clustering ratio test. Defaults to 0.05. |
0.05
|
clipping_thr
|
float
|
Threshold for the clipping detection test. Defaults to 0.05. |
0.05
|
sudden_jumps_thr
|
float
|
Threshold for the sudden jumps detection test. Defaults to 0.001. |
0.001
|
notch_filter_freq
|
float
|
Frequency (Hz) for the notch filter. Defaults to 50. |
50
|
Source code in src/contraqctor/qc/harp.py
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|
description
property
¶
name
property
¶
name: str
Get the name of the test suite.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The name of the test suite class. |
whoami
property
¶
whoami: int
Get the expected WhoAmI value for this device type.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The expected WhoAmI identifier. |
test_sniff_detector_sampling_rate ¶
test_sniff_detector_sampling_rate()
Tests if the sampling rate of the sniff detector is within nominal values
Source code in src/contraqctor/qc/harp.py
490 491 492 493 494 495 496 497 498 499 |
|
test_sniff_detector_signal_quality ¶
test_sniff_detector_signal_quality()
Tests the quality of the sniff detector signal by analyzing quantization, clustering, clipping, and sudden jumps.
Source code in src/contraqctor/qc/harp.py
501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
|
test_sniff_detector_physiology ¶
test_sniff_detector_physiology()
Tests if the sniff detector is actually detecting sniffs by analyzing peaks in the signal.
Source code in src/contraqctor/qc/harp.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
|
get_tests ¶
Find all methods starting with 'test'.
Yields:
Name | Type | Description |
---|---|---|
ITest |
ITest
|
Test methods found in the suite. |
Source code in src/contraqctor/qc/base.py
321 322 323 324 325 326 327 328 329 |
|
pass_test ¶
pass_test() -> Result
pass_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a passing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test passed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with PASSED status. |
Source code in src/contraqctor/qc/base.py
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
|
warn_test ¶
warn_test() -> Result
warn_test(
result: Any = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a warning test result.
Creates a result with WARNING status, or FAILED if warnings are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Any
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing the warning. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with WARNING or FAILED status. |
Source code in src/contraqctor/qc/base.py
525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
|
fail_test ¶
fail_test() -> Result
fail_test(
result: Optional[Any] = None,
message: Optional[str] = None,
*,
context: Optional[Any] = None,
) -> Result
Create a failing test result.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result
|
Optional[Any]
|
The value to include in the test result. |
None
|
message
|
Optional[str]
|
Optional message describing why the test failed. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with FAILED status. |
Source code in src/contraqctor/qc/base.py
600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
|
skip_test ¶
skip_test() -> Result
Create a skipped test result.
Creates a result with SKIPPED status, or FAILED if skips are elevated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message
|
Optional[str]
|
Optional message explaining why the test was skipped. |
None
|
context
|
Optional[Any]
|
Optional contextual data for the test result. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Result |
Result
|
A Result object with SKIPPED or FAILED status. |
Source code in src/contraqctor/qc/base.py
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 |
|
setup ¶
setup() -> None
Run before each test method.
This method can be overridden by subclasses to implement setup logic that runs before each test.
Source code in src/contraqctor/qc/base.py
685 686 687 688 689 690 691 |
|
teardown ¶
teardown() -> None
Run after each test method.
This method can be overridden by subclasses to implement teardown logic that runs after each test.
Source code in src/contraqctor/qc/base.py
693 694 695 696 697 698 699 |
|
run_test ¶
Run a single test method and yield its results.
Handles setup, test execution, result processing, and teardown.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
test_method
|
ITest
|
The test method to run. |
required |
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by the test method. |
Source code in src/contraqctor/qc/base.py
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
|
run_all ¶
Run all test methods in the suite.
Finds all test methods and runs them in sequence.
Yields:
Name | Type | Description |
---|---|---|
Result |
Result
|
Result objects produced by all test methods. |
Source code in src/contraqctor/qc/base.py
785 786 787 788 789 790 791 792 793 794 |
|
test_whoami ¶
test_whoami()
Check if the WhoAmI value is correct
Source code in src/contraqctor/qc/harp.py
406 407 408 409 410 411 412 413 414 |
|