def get_dir(self, path, revnum): try: return (None, self._paths[path], None) except KeyError: raise subvertpy.SubversionException("foo", subvertpy.ERR_FS_NOT_FOUND)
def test_proppatch_failed(self): self.assertIsInstance(convert_error( subvertpy.SubversionException("Proppatch failed", subvertpy.ERR_RA_DAV_PROPPATCH_FAILED)), PropertyChangeFailed)
def test_convert_perm_denied(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "Permission Denied", subvertpy.ERR_RA_NOT_AUTHORIZED)), PermissionDenied)
def test_convert_unexpected_end(self): self.assertIsInstance( convert_error( subvertpy.SubversionException("Unexpected end of stream", subvertpy.ERR_INCOMPLETE_DATA)), UnexpectedEndOfContainerError)
def test_convert_error_reset(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "Connection closed", subvertpy.ERR_RA_SVN_CONNECTION_CLOSED)), ConnectionReset)
def test_convert_error_lock(self): self.assertIsInstance( convert_error( subvertpy.SubversionException("Working copy locked", subvertpy.ERR_WC_LOCKED)), LockActive)
def test_convert_dav_request_failed(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "foo", subvertpy.ERR_RA_DAV_REQUEST_FAILED)), DavRequestFailed)
def test_convert_malformed(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "foo", subvertpy.ERR_RA_SVN_MALFORMED_DATA)), TransportError)
def test_throws_svn(): raise subvertpy.SubversionException( "Connection closed", subvertpy.ERR_RA_SVN_CONNECTION_CLOSED)
def test_convert_error_unknown(self): self.assertIsInstance( convert_error(subvertpy.SubversionException("foo", -4)), subvertpy.SubversionException)
def test_throws_svn(): raise subvertpy.SubversionException("foo", 2000)
def test_hook_failed(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "Hook failed", subvertpy.ERR_REPOS_HOOK_FAILURE)), TipChangeRejected)
def test_not_implemented(self): self.assertIsInstance( convert_error( subvertpy.SubversionException( "Remote server doesn't support ...", subvertpy.ERR_RA_NOT_IMPLEMENTED)), NotImplementedError)
def test_convert_unknown_hostname(self): self.assertIsInstance( convert_error( subvertpy.SubversionException("Unknown hostname 'bla'", subvertpy.ERR_UNKNOWN_HOSTNAME)), ConnectionError)
def test_exc(self): self.assertTrue( isinstance(subvertpy.SubversionException("foo", 1), Exception))