def testRequiredFields(self): required = MicrobiomeAssayPrep.required_fields() self.assertEqual(type(required), tuple, "required_fields() returns a tuple.") self.assertTrue(len(required) > 0, "required_fields() did not return empty value.")
def testRequiredFields(self): """ Test the required_fields() static method. """ required = MicrobiomeAssayPrep.required_fields() self.assertEqual(type(required), tuple, "required_fields() returns a tuple.") self.assertTrue(len(required) > 0, "required_fields() did not return empty value.")
def set_logging(): """ Setup logging. """ root = logging.getLogger() root.setLevel(logging.DEBUG) ch = logging.StreamHandler(sys.stdout) ch.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') ch.setFormatter(formatter) root.addHandler(ch) set_logging() session = iHMPSession(username, password) print("Required fields: ") print(MicrobiomeAssayPrep.required_fields()) prep = MicrobiomeAssayPrep() prep.comment = "Hello world!" prep.pride_id = "PRIDE ID" prep.center = "the center" prep.contact = "first name last name" prep.sample_name = "name of the sample" prep.experiment_type = "PRIDE:0000429, Shotgun proteomics" prep.prep_id = "the prep id" prep.storage_duration = 30 prep.study = "prediabetes" prep.title = "the title" # Optional properties
import json import logging from cutlass import MicrobiomeAssayPrep from cutlass import iHMPSession from pprint import pprint import tempfile import sys username = "******" password = "******" session = iHMPSession(username, password) print("Required fields: ") print(MicrobiomeAssayPrep.required_fields()) prep = MicrobiomeAssayPrep() prep.comment = "Hello world!" prep.pride_id = "PRIDE ID" prep.center = "the center" prep.contact = "first name last name" prep.sample_name = "name of the sample" prep.experiment_type = "PRIDE:0000429, Shotgun proteomics" prep.prep_id = "the prep id" prep.storage_duration = 30 prep.study = "prediabetes" prep.title = "the title"