def test_add_delete_namespace_nested(namespace): namespace.create() nested_ns = Namespace(name="Nested", parent=namespace) nested_ns.create() namespace.delete() assert not nested_ns.exists()
def namespace(request, domain): namespace = Namespace(name="System", description="System", parent=domain) namespace.create() request.addfinalizer(lambda: namespace.delete() if namespace.exists() else None) return namespace