Exemplo n.º 1
0
    def testRequiredFields(self):
        required = AbundanceMatrix.required_fields()

        self.assertEqual(type(required), tuple,
                         "required_fields() returns a tuple.")

        self.assertTrue(len(required) > 0,
                        "required_fields() did not return empty value.")
Exemplo n.º 2
0
    def testRequiredFields(self):
        """ Test the required_fields() static method. """
        required = AbundanceMatrix.required_fields()

        self.assertEqual(type(required), tuple,
                         "required_fields() returns a tuple.")

        self.assertTrue(
            len(required) > 0, "required_fields() did not return empty value.")
Exemplo n.º 3
0
    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("Creating a temp file for example/testing purposes.")
temp_file = tempfile.NamedTemporaryFile(delete=False).name
print("Local file: %s" % temp_file)

print("Required fields: ")
print(AbundanceMatrix.required_fields())

matrix = AbundanceMatrix()

matrix.comment = "test comment"
matrix.checksums = { "md5": "72bdc024d83226ccc90fbd2177e78d56" }
matrix.format = "fastq"
matrix.format_doc = "http://format.url"
matrix.matrix_type = "host_cytokine"
matrix.study = "prediabetes"
matrix.size = 1000
matrix.local_file = temp_file

# Optional properties
matrix.sop = "the SOP"
Exemplo n.º 4
0
    formatter = logging.Formatter(
        '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
    ch.setFormatter(formatter)
    root.addHandler(ch)


set_logging()

session = iHMPSession(username, password)

print("Creating a temp file for example/testing purposes.")
temp_file = tempfile.NamedTemporaryFile(delete=False).name
print("Local file: %s" % temp_file)

print("Required fields: ")
print(AbundanceMatrix.required_fields())

matrix = AbundanceMatrix()

matrix.comment = "test comment"
matrix.checksums = {"md5": "72bdc024d83226ccc90fbd2177e78d56"}
matrix.format = "csv"
matrix.format_doc = "http://format.url"
matrix.matrix_type = "host_cytokine"
matrix.study = "prediabetes"
matrix.size = 1000
matrix.local_file = temp_file
matrix.private_files = False

# Optional properties
matrix.sop = "the SOP"