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]
def setUp(self): dataRows = [] # Generate the Run object(s) runTest = Run() runTest.name = 'python upload' runTest.data_rows = dataRows runTest.properties['RunFieldName'] = 'Run Field Value' # Generate the Batch object(s) batch = Batch() batch.runs = [runTest] # batch.name = 'python batch' batch.properties['PropertyName'] = 'Property Value' self.configs = configs.copy() self.service = MockSaveBatch(**self.configs) self.expected_kwargs = { 'expected_args': [self.service.get_server_url()] , 'data': '{"assayId": 12345, "batches": [{"batchProtocolId": 0, "comment": null, "created": null, "createdBy": null, "lsid": null, "modified": null, "modifiedBy": null, "name": null, "properties": {"PropertyName": "Property Value"}, "runs": [{"comment": null, "created": null, "createdBy": null, "dataInputs": [], "dataRows": [], "experiments": [], "filePathRoot": null, "lsid": null, "materialInputs": [], "materialOutputs": [], "modified": null, "modifiedBy": null, "name": "python upload", "properties": {"RunFieldName": "Run Field Value"}}]}]}' , 'headers': {'Content-type': 'application/json', 'Accept': 'text/plain'} } self.args = [ server_context, assay_id, batch ]
"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)) print("Created By: " + run_group.created_by)
}, { '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' }] runTest.properties['RunFieldName'] = 'Run Field Value' # Generate the Batch object(s) batch = Batch() batch.runs = [runTest] batch.name = 'python batch' batch.properties['PropertyName'] = 'Property Value' # Execute save api saved_batch = save_batch(server_context, assay_id, batch) ################### # Load an Assay batch ################### batch_id = saved_batch.row_id # provide one from your server run_group = load_batch(server_context, assay_id, batch_id) if run_group is not None: print("Batch Id: " + str(run_group.id)) print("Created By: " + run_group.created_by)
}, { "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" } ] # Generate the Run object(s) runTest = Run() runTest.name = 'python upload' runTest.data_rows = dataRows runTest.properties['RunFieldName'] = 'Run Field Value' # Generate the Batch object(s) batch = Batch() batch.runs = [runTest] batch.name = 'python batch' batch.properties['PropertyName'] = 'Property Value' # Execute save api RESULT = save_batch(server_context, assay_id, batch) # RESULT = save_batches(server_context, assay_id, [batch1, batch2]) print(RESULT.id)