def setUp(self): data_rows = [] # Generate the Run object(s) run = Run() run.name = 'python upload' run.data_rows = data_rows run.properties['RunFieldName'] = 'Run Field Value' # Generate the Batch object(s) batch = Batch() batch.runs = [run] batch.properties['PropertyName'] = 'Property Value' self.service = MockSaveBatch() self.expected_kwargs = { 'expected_args': [self.service.get_server_url()], 'data': '{"assayId": 12345, "batches": [{"batchProtocolId": 0, "comment": null, "created": null, "createdBy": null, "modified": null, "modifiedBy": null, "name": null, "properties": {"PropertyName": "Property Value"}, "runs": [{"comment": null, "created": null, "createdBy": null, "dataInputs": [], "dataRows": [], "experiments": [], "filePathRoot": null, "materialInputs": [], "materialOutputs": [], "modified": null, "modifiedBy": null, "name": "python upload", "properties": {"RunFieldName": "Run Field Value"}}]}]}', 'headers': { 'Content-type': 'application/json', 'Accept': 'text/plain' }, 'timeout': 300 } self.args = [mock_server_context(self.service), assay_id, batch]
def setUp(self): data_rows = [] # Generate the Run object(s) run = Run() run.name = "python upload" run.data_rows = data_rows run.properties["RunFieldName"] = "Run Field Value" # Generate the Batch object(s) batch = Batch() batch.runs = [run] batch.properties["PropertyName"] = "Property Value" self.service = MockSaveBatch() self.expected_kwargs = { "expected_args": [self.service.get_server_url()], "data": '{"assayId": 12345, "batches": [{"batchProtocolId": null, "comment": null, "created": null, "createdBy": null, "modified": null, "modifiedBy": null, "name": null, "properties": {"PropertyName": "Property Value"}, "runs": [{"name": "python upload", "properties": {"RunFieldName": "Run Field Value"}}]}]}', "headers": { "Content-Type": "application/json" }, "timeout": 300, } self.args = [mock_server_context(self.service), assay_id, batch]
"SampleId": "Monkey 2", "TimePoint": "2008/11/02 14:00:01", "DoubleData": 3.1, "HiddenData": "fozzy bear", }, { "SampleId": "Monkey 3", "TimePoint": "2008/11/02 14:00:01", "DoubleData": 1.5, "HiddenData": "jimbo", }, ] run_test.properties["RunFieldName"] = "Run Field Value" # Generate the Batch object(s) batch = Batch() batch.runs = [run_test] batch.name = "python batch" batch.properties["PropertyName"] = "Property Value" # Execute save api saved_batch = api.experiment.save_batch(assay_id, batch) ################### # Load an Assay batch ################### batch_id = saved_batch.row_id # provide one from your server run_group = api.experiment.load_batch(assay_id, batch_id) if run_group is not None: print("Batch Id: " + str(run_group.id))