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_)
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)
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)
def test_create_01(): """Create term.""" term = tu.create_term() tu.assert_object(term, pyessv.Term) tu.assert_int(pyessv.get_count(), 0)