def fetch(self, pubid_or_groupid): """ Fetch a group using either a groupid or a pubid. :arg pubid_or_groupid: a string in either :mod:`~h.pubid` format or as :attr:`h.models.Group.groupid` :rtype: :class:`~h.models.Group` or ``None`` """ if group_util.is_groupid(pubid_or_groupid): return self.fetch_by_groupid(pubid_or_groupid) return self.fetch_by_pubid(pubid_or_groupid)
def test_it_detects_groupid_validity(self, maybe_groupid, result): assert group_util.is_groupid(maybe_groupid) is result