From 4fa142ee2546567605e138098bbd6788f184421b Mon Sep 17 00:00:00 2001 From: Thomas Moore Date: Tue, 3 Mar 2020 15:14:30 -0500 Subject: [PATCH] Fix validators documentation (#926) * Fix validators documentation * Update validators.py * Update json_factory.py --- openhtf/output/callbacks/json_factory.py | 2 +- openhtf/util/validators.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openhtf/output/callbacks/json_factory.py b/openhtf/output/callbacks/json_factory.py index d678cf586..b6b6fdf5d 100644 --- a/openhtf/output/callbacks/json_factory.py +++ b/openhtf/output/callbacks/json_factory.py @@ -27,7 +27,7 @@ class OutputToJSON(callbacks.OutputToFile): '/data/test_records/%(dut_id)s.%(start_time_millis)s' To use this output mechanism: test = openhtf.Test(PhaseOne, PhaseTwo) - test.add_output_callback(openhtf.output.callbacks.OutputToJson( + test.add_output_callback(openhtf.output.callbacks.OutputToJSON( '/data/test_records/{dut_id}.{metadata[test_name]}.json')) Args: diff --git a/openhtf/util/validators.py b/openhtf/util/validators.py index 7d5a2c063..f913e2eb3 100644 --- a/openhtf/util/validators.py +++ b/openhtf/util/validators.py @@ -5,9 +5,8 @@ module, and will typically be a type, instances of which are callable: from openhtf.util import validators - from openhtf.util import measurements - class MyLessThanValidator(ValidatorBase): + class MyLessThanValidator(validators.ValidatorBase): def __init__(self, limit): self.limit = limit @@ -35,7 +34,7 @@ def LessThan4(value): return value < 4 @measurements.measures( - measurements.Measurement('my_measurement).with_validator(LessThan4)) + measurements.Measurement('my_measurement').with_validator(LessThan4)) def MyPhase(test): test.measurements.my_measurement = 5 # Will also 'FAIL'