from kwiver.sprokit.pipeline import datum ads_in = adapter_data_set.AdapterDataSet.create() ads_in["detected_object_set"] = _create_detected_object_set() print("Starting roundtrip pipeline with a detected_object_set") run_roundtrip_pipeline(py_pipeline_dir, ads_in) # Create fresh objects. Make sure that this also works with adding datums directly ads_in = adapter_data_set.AdapterDataSet.create() ads_in["detected_object_set"] = datum.new(_create_detected_object_set()) print( "Starting roundtrip pipeline with a datum containing a detected_object_set" ) run_roundtrip_pipeline(py_pipeline_dir, ads_in) if __name__ == "__main__": import os import sys if len(sys.argv) != 4: test_error("Expected four arguments") sys.exit(1) testname = sys.argv[1] cpp_pipeline_dir = sys.argv[2] py_pipeline_dir = sys.argv[3] run_test(testname, find_tests(locals()), cpp_pipeline_dir, py_pipeline_dir)
datum.new_track_set, None, ) expect_exception( "attempting to store None as a timestamp", TypeError, datum.new_timestamp, None, ) # Should also fail for the automatic type conversion expect_exception( "attempting to store none through automatic conversion", TypeError, datum.new, None, ) if __name__ == '__main__': import sys if len(sys.argv) != 2: test_error("Expected two arguments") sys.exit(1) testname = sys.argv[1] run_test(testname, find_tests(locals()))
p.add_process(s1) p.add_process(s2) p.add_process(m) p.add_process(t) p.connect(name_source1, port_output, name_mult, port_factor1) p.connect(name_source2, port_output, name_mult, port_factor2) p.connect(name_mult, port_product, name_sink, port_input) p.setup_pipeline() run_pipeline(sched_type, p, c) check_file(output_file, [a * b for a, b in zip(list(range(min1, max1)), list(range(min2, max2)))]) if __name__ == '__main__': import sys if len(sys.argv) != 2: test_error("Expected two arguments") sys.exit(1) (testname, sched_type) = tuple(sys.argv[1].split('-', 1)) run_test(testname, find_tests(locals()), sched_type)