Skip to content

Commit

Permalink
Merge pull request #429 from wallacbe/output
Browse files Browse the repository at this point in the history
update output module imports in all_the_things
  • Loading branch information
fahhem authored Sep 1, 2016
2 parents 5549fd5 + 27b7520 commit 68bc933
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions examples/all_the_things.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
import openhtf as htf
from openhtf.util import units
from openhtf.plugs import user_input
from openhtf.output import callbacks
from openhtf.output.callbacks import json_factory
from openhtf.output.callbacks import mfg_inspector

import example_plug

Expand Down Expand Up @@ -99,25 +102,22 @@ def teardown(test):
# but you can include any metadata fields.
test_name='MyTest', test_description='OpenHTF Example Test',
test_version='1.0.0')
test.add_output_callbacks(htf.output.callbacks.OutputToFile(
test.add_output_callbacks(callbacks.OutputToFile(
'./{dut_id}.{metadata[test_name]}.{start_time_millis}.pickle'))
test.add_output_callbacks(
htf.output.callbacks.json_factory.OutputToJSON(
'./{dut_id}.{metadata[test_name]}.{start_time_millis}.json',
indent=4))
test.add_output_callbacks(json_factory.OutputToJSON(
'./{dut_id}.{metadata[test_name]}.{start_time_millis}.json', indent=4))

# Example of how to output to testrun protobuf format.
#test.add_output_callbacks(
# htf.output.callbacks.mfg_inspector.OutputToTestRunProto(
# './{dut_id}.{start_time_millis}.pb'))
# mfg_inspector.OutputToTestRunProto('./{dut_id}.{start_time_millis}.pb'))

# Example of how to upload to mfg-inspector. Replace filename with your
# JSON-formatted private key downloaded from Google Developers Console
# when you created the Service Account you intend to use, or name it
# 'my_private_key.json'.
#if os.path.isfile('my_private_key.json'):
# with open('my_private_key.json', 'r') as json_file:
# test.add_output_callbacks(output.UploadToMfgInspector.from_json(
# test.add_output_callbacks(mfg_inspector.UploadToMfgInspector.from_json(
# json.load(json_file)))

#test.configure(teardown_function=teardown)
Expand Down

0 comments on commit 68bc933

Please sign in to comment.