def test__raise_if_notsuccess(self): grn = Groonga() try: grn._raise_if_notsuccess(_groonga.SUCCESS) except GroongaError: self.fail("GroongaError has been raised") from pyroonga.exceptions import error_messages for rc in [rc for rc in error_messages if rc != _groonga.SUCCESS]: self.assertRaises(GroongaError, grn._raise_if_notsuccess, rc)
def test__raise_if_notsuccess_with_not_success(self, rc): grn = Groonga() with pytest.raises(GroongaError): grn._raise_if_notsuccess(rc, "", "")
def test__raise_if_notsuccess_with_success(self): grn = Groonga() try: grn._raise_if_notsuccess(_groonga.SUCCESS, "", "") except GroongaError: assert False, "GroongaError has been raised"