Esempio n. 1
0
    def testRequiredFields(self):
        required = Project.required_fields()

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

        self.assertTrue(
            len(required) > 0, "required_field() did not return empty value.")
Esempio n. 2
0
    def testRequiredFields(self):
        required = Project.required_fields()

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

        self.assertTrue(len(required) > 0,
                        "required_field() did not return empty value.")
Esempio n. 3
0
#!/usr/bin/env python

import json
import logging
from cutlass import Project
from cutlass import iHMPSession
from pprint import pprint

username = "******"
password = "******"

session = iHMPSession(username, password)

print("Required fields are:")
print(Project.required_fields())

proj = Project()

mixs_data = {
      "biome": "blah",
      "body_product": "blah",
      "collection_date": "blah",
      "env_package": "blah",
      "feature": "blah",
      "geo_loc_name": "blah",
      "lat_lon": "blah",
      "material": "blah",
      "project_name": "blah",
      "rel_to_oxygen": "blah",
      "samp_collect_device": "blah",
      "samp_mat_process": "blah",
Esempio n. 4
0
from cutlass_utils import save_if_valid, \
    load_string_from_file, \
    load_config_from_file
from cutlass import iHMPSession
from cutlass import Project as OSDFNode

# Project info file name
info_file = '../data_files/project_info.yaml'

# load username, password from files
username = load_string_from_file('../auth/username.txt')
password = load_string_from_file('../auth/password.txt')

session = iHMPSession(username, password)

print("Required fields: {}".format(OSDFNode.required_fields()))

# load project info from info_file
config = load_config_from_file(info_file)
for node_info in config:
    node = OSDFNode()

    node.name = node_info['name']
    node.description = node_info['description']
    node.center = node_info['center']
    node.contact = node_info['contact']
    node.srp_id = node_info['srp_id']
    node.tags = node_info['tags']
    node.mixs = node_info['mixs']

    # print(node.to_json(indent=2))