Example #1
0
 def _assert(term):
     """Asserts an update."""
     count = pyessv.get_count()
     pyessv.save(term)
     tu.assert_int(pyessv.get_count(), count)
     term_ = pyessv.get_term(term.domain, term.subdomain, term.kind, term.name)
     tu.assert_terms(term, term_)
Example #2
0
def _setup():
	"""Test runner setup.

	"""
	tu.setup()
	term = tu.create_term()
	pyessv.save(term)
Example #3
0
def _setup():
    """Test runner setup.

    """
    tu.setup()
    count = pyessv.get_count()
    term = tu.create_term()
    pyessv.save(term)
    tu.assert_int(pyessv.get_count(), count + 1)
Example #4
0
def _test(governance_action, governance_status):
    """Performs governance tests.

    """
    term = tu.get_term()
    tu.assert_str(term.status, pyessv.GOVERNANCE_STATUS_PENDING)
    governance_action(term)
    tu.assert_str(term.status, governance_status)
    pyessv.save(term)

    tu.setup()
    term = tu.get_term()
    tu.assert_str(term.status, governance_status)
Example #5
0
def _test(governance_action, governance_status):
    """Performs governance tests.

    """
    term = tu.get_term()
    tu.assert_str(term.status, pyessv.GOVERNANCE_STATUS_PENDING)
    governance_action(term)
    tu.assert_str(term.status, governance_status)
    pyessv.save(term)

    tu.setup()
    print "ZZZ", pyessv.get_count()
    term = tu.get_term()
    print id(term)
    tu.assert_str(term.status, governance_status)
def _main(args):
    """Main entry point.

    """
    if not os.path.isdir(args.source):
        raise ValueError("WCRP vocab directory does not exist")

    # Create CMIP6 collections.
    for typeof, data_factory in _COLLECTIONS_CMIP6.items():
        _create_collection_cmip6(args.source, typeof, data_factory)

    # Create GLOBAL collections.
    for typeof, data_factory in _COLLECTIONS_GLOBAL.items():
        _create_collection_global(args.source, typeof, data_factory)

    # Add to the archive.
    pyessv.add(_AUTHORITY)

    # Save (to file system).
    pyessv.save()