示例#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_)
示例#2
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)
示例#3
0
def test_delete():
    """pyessv-tests: authoring: deleting a term.

    """
    count = pyessv.get_count()
    term = tu.get_term()
    pyessv.delete(term)
    tu.assert_int(pyessv.get_count(), count - 1)
    term = tu.get_term()
    tu.assert_none(term)
示例#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()
    print "ZZZ", pyessv.get_count()
    term = tu.get_term()
    print id(term)
    tu.assert_str(term.status, governance_status)
示例#5
0
 def test_create_01():
     """Create term."""
     term = tu.create_term()
     tu.assert_object(term, pyessv.Term)
     tu.assert_int(pyessv.get_count(), 0)